c#系统语音播报

时间:2024-04-04 14:32:44

首先添加引用,System.Speech

c#系统语音播报

添加using指令:using System.Speech.Synthesis;

之后代码

            SpeechSynthesizer synth = new SpeechSynthesizer();
            synth.Rate = 1;       //设置语速
            synth.Speak(播报的内容);
            synth.Dispose();     //释放资源