首页 > 代码库 > C# 文字转声音

C# 文字转声音

添加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();        }

  

 

C# 文字转声音