第一步 -> 添加COM类库 引用 ->Microsoft Speech Object Library
第二步 -> 引用 using SpeechLib;
第三步骤 执行代码
var str = textBox1.Text;
SpeechVoiceSpeakFlags flag = SpeechVoiceSpeakFlags.SVSFlagsAsync;
SpVoice voice = new SpVoice();
int num=3;
for (int i = 0; i < num; i++)
{
string voice_txt = "请"+str+"到就诊部就诊";
voice.Voice = voice.GetVoices(string.Empty, string.Empty).Item(0);
voice.Speak(voice_txt, flag);
}
语音播报
原文:https://www.cnblogs.com/sunda888/p/10734653.html