版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/csharp25/article/details/84679567
1. 引入System.Speech.dll2. 实现:
static void Main(string[] args)
{
SpeechSynthesizer synthesizer = new SpeechSynthesizer();
synthesizer.Volume = 100; // 0...100
synthesizer.Rate = -3; // -10...10
// Synchronous
synthesizer.Speak("Hello , Microsoft");
// Asynchronous
//synthesizer.SpeakAsync("Hello World");
Console.ReadLine();
}