<audio autoplay="" src="http://translate.google.com/translate_tts?ie=utf-8&tl=en&q=hello%20world"></audio>
这在html中工作正常,但在gsp中却不能。
反馈:
GET http://translate.google.com/translate_tts?ie=utf-8&tl=en&q=hello%20world 404(未找到)
很好奇:如果我一次使用网址(直接),则从Google接收到的mp3在缓存中并且可以使用。
这也可以(在jsp中):
<iframe src="http://translate.google.com/translate_tts?ie=utf-8&tl=en&q=hello%20world"></iframe>
最佳答案
Google使用引荐来源网址(以及不受欢迎的用户代理)阻止 call 。通过单击浏览器中的链接,您正在发送引荐来源。
不起作用(无引用,cURL useragent):
curl -v 'http://translate.google.com/translate_tts?ie=utf-8&tl=en&q=hello%20world'
作品(无推荐人):
curl -v -A 'Mozialla' 'http://translate.google.com/translate_tts?ie=utf-8&tl=en&q=hello%20world'
无效:
curl -v -A 'Mozialla' -e 'www.stackoverflow.com' 'http://translate.google.com/translate_tts?ie=utf-8&tl=en&q=hello%20world'
关于jsp - 如何在Web资源的JSP中使用音频标签? -ils,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28207021/