2014-10-30 22 views

回答

0

這裏是一個工作示例:

using System.Speech.Synthesis; 

static void Main(string[] args) 
{ 
    ... 
    // Speech helper 
    SpeechSynthesizer reader = new SpeechSynthesizer(); 
    const string msg = "Hello"; 
    Console.WriteLine(msg); 
    reader.SpeakAsync(msg); 
} 

此外,還要確保您引用 'System.Speech':

enter image description here

+0

謝謝你,這個工作 – ProgrammingPotato 2014-10-30 17:25:59

0

您需要添加引用到您的項目。參考資料,右鍵單擊,找到它後添加參考。

如果仍然不起作用,您需要右鍵單擊變量上的.cs文件並解析爲System.Speech。