首先添加引用,System.Speech

c#系统语音播报

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

之后代码

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

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-02
  • 2022-01-08
  • 2021-05-19
  • 2021-12-24
  • 2022-12-23
猜你喜欢
  • 2021-12-16
  • 2021-11-23
  • 2021-11-17
  • 2022-12-23
  • 2021-11-29
  • 2021-12-21
  • 2021-10-06
相关资源
相似解决方案