2010-04-09 74 views

回答

3

您需要.NET 3.0本:

public void TextToSpeech(string text, string fileName) 
{ 
    using (var stream = File.Create(fileName)) 
    { 
     SpeechSynthesizer speechEngine = new SpeechSynthesizer(); 
     speechEngine.SetOutputToWaveStream(stream); 
     speechEngine.Speak(text); 
     stream.Flush(); 
    } 
} 
相關問題