hello everybody! i'm new here but i hope you can help me.
i'm trying to create a button that plays the text to speech mp3 that google generates. i'm creating a translator, so, what i want is to do something like google translate is (in some way).
i've tried with javascript and actionscript but i couldn't make it work.
i have this javascript function:
function audio () {
// here i get the word that i want to hear
texto = document.getElementById('txt-result-palabra').innerHTML;
// now i get the language
idioma = document.getElementById("id-traducir-palabra").value;
url = "http://translate.google.com/translate_tts?q=";
url += texto;
url += "&tl=";
url += idioma;
}
so, with this function i actually have the url of the google tts for some word, but i don't know how to embed it, o which is the best way to do it. i mean, i can embed it with javascript, but i'm not sure if it's gonna work since the file that google generates is an mp3.
and i need this mp3 to be played onClick of an image...
i also wonder if it could be done with html5.
if anyone knows any solution i'd appreciate it a lot!
thanks in advance and have a great day!!!