c#系统语音播报

首先添加引用,System.Speech

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

之后代码

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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章