Tom*_*che 8 html javascript html5 text-to-speech google-translate
我正在尝试使用HTML5和Google翻译在网站上使用文字转语音.
从Google获取演讲就像GET请求一样简单:http: //translate.google.com/translate_tts?tl = en&q = hello
为了播放该文件我正在使用audio-tag:
<audio id="speech" src="http://translate.google.com/translate_tts?tl=en&q=hello" controls="controls" autoplay="autoplay">Your browser does not support the audio element.</audio>
当我尝试使用Chrome 11在本地打开html文件时,这非常有效,但是当我从服务器打开html时它根本不起作用...它只是没有做任何事情(播放按钮闪烁一秒钟,但没有任何反应).
您可以在此处找到该文件:http://www.announcify.com/chrome/background.html
有任何想法吗?:)
汤姆
确保您的 rel 标签设置正确。谷歌可能有跨域保护。