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

前端 未结 2 795
攒了一身酷
攒了一身酷 2021-01-28 03:12

I\'m working on a project which will speak the content of browsed web page.Browser is made by me using WebControl. I\'m using SAPI for speech engine. I wanted to highlight the l

相关标签:
2条回答
  • 2021-01-28 03:54

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

    0 讨论(0)
  • 2021-01-28 04:14

    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!

    0 讨论(0)
提交回复
热议问题