Reputation: 3
I'm trying to make a TTS DLL using SAPI. Passing text to be spoken is easy enough, but I'm having a problem. My secondary program has no way of knowing when TTS is done if I use ASYNC. I need to use ASYNC so the user can continue to use the program while TTS is still going, and so they would have the option to call the DLL again to stop it early. Using non async would make my secondary program freeze until TTS is finished speaking.
I tried to take two approaches:
I tried to use the speech synth STATE command. But it doesn't check if any TTS voice is running, only if a supplied one is running. So being able to call the ASYNC function, then a second later call the STATE function doesn't seem possible since I can't see a way to pass information from the first function to the second with a secondary program in the middle.
A work around would be if I could know exactly how long the voice is going to be speaking at the time I call it through a DLL. But while I can call the RATE, that doesn't seem to help me calculate how long it's going to be speaking.
This secondary program that is calling this DLL is not in C#, so can't simply pass around the synthesizer info that is created.
What can I look into for this?
Upvotes: 0
Views: 181