How do I play sound files in HTML5?

Kenji Kojima index at kenjikojima.com
Thu Oct 5 17:43:46 EDT 2017


Hi,

I can not play a sound file in HTML5. Did anybody play a sound file in HTML?

I tried the tutorial “Play sound files in HTML5”. 
http://lessons.livecode.com/m/4071/l/742506-how-do-i-play-sound-files-in-html5 <http://lessons.livecode.com/m/4071/l/742506-how-do-i-play-sound-files-in-html5>

This is the url I made. 
http://kenjikojima.com/HTML5PlaySound/HTML5PlaySound.html <http://kenjikojima.com/HTML5PlaySound/HTML5PlaySound.html>

I made exactly same stack and added 
<audio id="myAudio">
    <source src="piano-melody.wav" type="audio/wav">
  </audio>
to the <body> in the HTML file.  
The sound file name is "piano-melody.wav”, and put it into the same folder.

I use macOS LiveCode Indy Edition 8.1.6. 

This is a JavaScript test file. 
http://kenjikojima.com/HTML5PlaySound/jsTest.html <http://kenjikojima.com/HTML5PlaySound/jsTest.html>
It works. 

Thanks,
--
Kenji Kojima / 小島健治
http://kenjikojima.com






More information about the use-livecode mailing list