Synchronization Problem for SAPI or (text to speech ) … C#

旧城冷巷雨未停 提交于 2019-12-02 11:32:45

get all the sentences into one string, and call the speak just once. replace ur for loop with below:

string str1 = "";
for (int i = 0; i < splitSentences.Length; i++) 
{ 
     str1 += highlight(splitSentences[i]); 
}
sound_object.Speak(str1, SpeechLib.SpeechVoiceSpeakFlags.SVSFlagsAsync);

hope this helps!

You need to do the next line after the previous line finishes, using the TTS's completion event.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!