2013-03-08 61 views
1

我目前正在一个C#项目,并希望用户键入一个句子,然后说这个语句使用谷歌文本到语音引擎。我不能使用C#语音合成器,因为它只支持英语,我想用阿拉伯语。有谁知道如何调用google tts?C#和谷歌说

回答

0

这是一个示例代码,做的:

using (WebClient client = new WebClient()) 
{ 
    client.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows)"); 
    client.DownloadFile("http://translate.google.com/translate_tts?tl=ar&q=مرحبا العالم", "HelloWorld.wav"); 
} 

这将节省HelloWorld.wav文件,其中包含q参数背后的短语 - 对不起,如果它并不真正意味着什么阿拉伯语:-)