0

如何从网站下载谷歌翻译 mp3 "http://translate.google.com/translate_tts?tl=en&q=hello+world"

我正在使用以下代码:

    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 文件?

4

1 回答 1

0

这需要一些挖掘,但您没有得到响应,因为 WebClient 会随请求发送引荐来源信息。

目前,似乎无法从标题中删除此引荐来源网址。

请参阅http://forums.create.msdn.com/forums/p/63150/470991.aspx

http://techcrunch.com/2009/12/14/the-unofficial-google-text-to-speech-api/

于 2011-03-13T18:55:40.027 回答