2013-03-08 29 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參數背後的短語 - 對不起,如果它並不真正意味着什麼阿拉伯語:-)