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(); }
如果您觉得本文对你有用,不妨帮忙点个赞,或者在评论里给我一句赞美,小小成就都是今后继续为大家编写优质文章的动力!
欢迎您持续关注我的博客:)
版权所有,欢迎保留原文链接进行转载:)