I have a page where there is a list of vocabularies. I have a TTS for each vocabulary. The current approach that I am using is to include an mp3 flash player for each vocabulary. This creates delay to load all the flash because there can be more than 10 vocabularies in one page.
another problem is that the mp3 of the tts file has to be created on the page load, this also gives delay to the loading time.
Some alternative approach in my mind is to:
So my question is,
Is there any javascript or jquery plugin that can do either of the 2 other approaches?
thank you
You can use the <audio>
tag (HTML5) and you can control it when to load the files.
It is supported in most of the browsers like Google Chrome, Firefox, Opera...
It has two ways to set the link:
<audio src="YOUR FILE LINK HERE">
<embed> <!--FALLBACK HERE (FLASH PLAYER FOR IE)--> </embed>
</audio>
<audio>
<source src="YOUR FILE LINK HERE (MP3)" type="audio/ogg" />
<source src="YOUR OTHER FILE LINK HERE (OGG)" type="audio/mp3" />
<embed> <!--FALLBACK HERE (FLASH PLAYER FOR IE)--> </embed>
</audio>
controls="controls"
if you want it to display the audio player.loop="loop"
if you want it to loop the audio.autoplay="autoplay"
if you want it to play the audio by itself.preload="preload"
if you want it to preload it.You can also control it using JavaScript.
To play it: document.getElementById("YOUR AUDIO TAG")
.play()
To pause it: document.getElementById("YOUR AUDIO TAG")
.pause()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With