添加COM组件引用:Microsoft Speech object library

        private SpVoice voice; 
        private void button1_Click(object sender, EventArgs e)
        {
             voice = new SpVoice();
            voice.Rate = 0;
            voice.Volume = 100;
            voice.Speak(textBox1.Text, SpeechVoiceSpeakFlags.SVSFlagsAsync);

        }

        private void button2_Click(object sender, EventArgs e)
        {
            voice.Pause();
        }

        private void button3_Click(object sender, EventArgs e)
        {
            voice.Resume();
        }

  

 

相关文章:

  • 2021-05-19
  • 2021-12-23
  • 2021-12-23
  • 2021-09-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-06-16
  • 2021-06-18
  • 2021-12-17
  • 2022-12-23
  • 2022-12-23
  • 2021-05-30
相关资源
相似解决方案