在 Windows Phone 7 中,如何从网站“http://translate.google.com/translate_tts?tl=en&q=hello+world”下载 Google 翻译 mp3?
如何从网站 "http://translate.google.com/translate_tts?tl=en&q=hello+world"
下载 Google 翻译 mp3?
我正在使用以下代码:
WebClient wc = new WebClient();
wc.Encoding = Encoding.UTF8;
wc.AllowReadStreamBuffering = true;
wc.OpenReadCompleted += WcOpenReadCompleted;
wc.OpenReadAsync(new Uri("http://translate.google.com/translate_tts?tl=en&q=hello+world", UriKind.Absolute));
void WcOpenReadCompleted(object sender, OpenReadCompletedEventArgs e)
{
}
在读取完成时,我收到 System.Net.WebException
。
如何从该页面读取 mp3 文件?
或者有什么办法可以播放该mp3文件吗?
How to download the Google translate mp3 from site "http://translate.google.com/translate_tts?tl=en&q=hello+world"
?
I'm using the following code:
WebClient wc = new WebClient();
wc.Encoding = Encoding.UTF8;
wc.AllowReadStreamBuffering = true;
wc.OpenReadCompleted += WcOpenReadCompleted;
wc.OpenReadAsync(new Uri("http://translate.google.com/translate_tts?tl=en&q=hello+world", UriKind.Absolute));
void WcOpenReadCompleted(object sender, OpenReadCompletedEventArgs e)
{
}
In read completed, I'm getting System.Net.WebException
.
How can I read the mp3 file from that page?
or is there any way to play that mp3 file?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这需要一些挖掘,但您没有得到响应,因为 WebClient 随请求发送了引用者信息。
目前似乎无法从标头中删除此引荐来源网址。
请参阅 http://forums.create.msdn.com/forums/p/ 63150/470991.aspx 和
http://techcrunch.com/2009/12/14/the-unofficial-google-text-to-speech-api/
This took a bit of digging but you do not get a response because the WebClient sends referrer info with the request.
At the moment it does not seem possible to remove this referrer from the headers.
See http://forums.create.msdn.com/forums/p/63150/470991.aspx and
http://techcrunch.com/2009/12/14/the-unofficial-google-text-to-speech-api/