How Can I download Text to Speech data from google translate?

c#, google-translate, text-to-speech

Solution

just use this link to download the MP3:

http://translate.google.com/translate_tts?tl=el&q=%22hello%22

Edit: Be aware Some Browsers like Firefox replaces the %22 with " and the link doesnt work so you need to copy it and cant click it!

How to Download Files: http://www.csharp-examples.net/download-files/

http://msdn.microsoft.com/en-us/library/ez801hhe.aspx

How to Play MP3: http://msdn.microsoft.com/en-us/library/4y171b18.aspx

using System.Media;

String strTextYouWantAsMp3 = "Hello";
WebClient webClient = new WebClient();
webClient.DownloadFile("http://translate.google.com/translate_tts?tl=el&q=%22" + strTextYouWantAsMp3 + "%22", @"c:\audio.mp3");

SoundPlayer simpleSound = new SoundPlayer(@"c:\audio.mp3");
simpleSound.Play();

Problem

I am trying to create an app that speaks Greek. But since Microsoft does not support Greek as a spoken language and my question on guidelines on how to create my own lexicon (here) I am asking this: How may I download an mp3 (or just the data doesn't matter) that includes the text that I sent to google translate on runtime and play it using C#?

Original source

Related problems