c# - Minimize lag when using System.Speech.Synthesis -
i playing using tts built .net 4 , want speech happen immediately, instead encountering lag between when call speak , when audio. i developing simple count-down timer calls off last 5 seconds , completion (5... 4... 3... 2... 1... done), when screen updates new time, tts lags behind, getting worse every invocation. tried using speakasync, made worse. currently, speak being called outside ui thread (in timer tick event handler). is there way minimize lag, such pre-computing speech , caching or creating kind of special tts thread? i somehow read past api call needed @ least hundred times. looking speechsynthesizer.setoutputtowavestream . memorystream stream = new memorystream(); speechsynthesizer synth = new speechsynthesizer(); synth.setoutputtowavestream(stream); synth.play(text); stream.position = 0; soundplayer player = new soundplayer(stream); player.play(); this code use tts turn text wav file streamed stream. need reset position of memorystream when creat...