0

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?

koregan
  • 10,054
  • 4
  • 23
  • 36
prashanth
  • 1
  • 5

1 Answers1

0

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/

koregan
  • 10,054
  • 4
  • 23
  • 36