play sounds in HTML5

Alain Vezina alain.vezina at logilangue.com
Wed May 15 16:44:41 EDT 2019


Thanks Sean,

You did not misunderstand my request.

You make me go one step forward : now I can call a sound to be played from a folder where there are several other sound.

Now, how can I played a sound chosen by random your chosen by the user; in other words, how can I replace "piano-melody.wav" by the name of the chosen sound, never knowing wich sound will be chosen by the user or by a random procedure ? How my program can write in an HTML file, considering there is a list of all the soud files including the extention .WAV or .MP3 or another one?

Regards

Alain


> Le 14 mai 2019 à 17:02, Pi Digital via use-livecode <use-livecode at lists.runrev.com> a écrit :
> 
> Hi Alain
> 
> The key here is in the line
> 
> <source src="piano-melody.wav" type="audio/wav">
> 
> Instead of just piano-melody.wav you would put in the whole path or relative path to the file. Example, if your file structure has a folder called ‘html’ containing your html file and then another folder called ‘audio’ which contains all your audio files including one called piano-melody.wav then the code would read
> 
> <source src="/audio/piano-melody.wav" type="audio/wav">
> 
> This points to the file in a relative path to the html file itself. 
> 
> Does this help or have I misunderstood your request?
> 
> Regards
> 
> Sean Cole
> Pi Digital Prod Ltd
> 
>> On 14 May 2019, at 20:52, Alain Vezina via use-livecode <use-livecode at lists.runrev.com> wrote:
>> 
>> Hi all,
>> 
>> Is there somebody who knows how to play one sound after another using the path of each sound.
>> 
>> I read the lesson [ How do I play sound files in HTML5? ] where I have to type the name the sound in the HTML file and to put the sound file into the standalone folder.
>> 
>> You know, I want to use one of my sounds libraries as I did into a standalone for Mac, PC , IOS or Android : you specify once the path of the library and the name of the sound you want to be played. The sounds library is not in the app and every sound has his proper name. So I can play a sound chosen by random  or chosen by the user.
>> 
>> Alain Vezina
>> Logilangue
>> www.logilangue.com
>> 
>> 
>> 
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list