如何将 jsp 中的音频标签与网络资源一起使用? - 圣杯

How to use audio tag in jsp with a web source? - grails

<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(未找到)
好奇:如果我使用 url(直接)一次,接收到的 mp3(来自 google)在缓存中并且可以工作。
这也适用(在 jsp 中):

<iframe src="http://translate.google.com/translate_tts?ie=utf-8&tl=en&q=hello%20world"></iframe>

Google 阻止使用 referer 的调用(以及来自不受欢迎的用户代理的调用)。单击浏览器中的 link,即表示您正在发送引荐来源网址。

无效(无引用,cURL 用户代理):

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.whosebug.com' 'http://translate.google.com/translate_tts?ie=utf-8&tl=en&q=hello%20world'