I have a problem with playing audio from a dynamically created javascript audio object one after another. The Audio comes from Google over an array of strings.
<
There is an ended event, you can change the src
property in a listener for it.
var strings = "Hello how are you".split(" ");
var index = 1;
audio.src='http://translate.google.com/translate_tts?&tl=en&q=' + strings[0];
audio.play();
audio.onended = function() {
if(index < strings.length){
audio.src='http://translate.google.com/translate_tts?&tl=en&q=' + strings[index];
audio.play();
index++;
}
};