Blocks the client application until the port is idle (not decoding).
int WaitForEngineToIdle(int MillisecondsToWait, int VoiceChannel = -1);
Zero (0) or greater indicates success. The decode is finished.
A negative result indicates a specific error:
-1: LV_FAILURE: The decode failed.
-6: LV_TIME_OUT: The timeout was reached before the Engine became idle.
MillisecondsToWait
The number of milliseconds to wait before returning if the Speech Port does not become idle.
VoiceChannel
Which VoiceChannel to wait on, -1 waits on all voice channels for the port.
Some of the LV_SRE functions run asynchronously, in particular, Decode. WaitForEngineToIdle is primarily useful when Decode is called without LV_DECODE_BLOCK. In this case, Decode returns immediately, but continues processing the voice channel's audio data in a separate thread. Since client applications will eventually need the results, the clients need a way to query the port to see if Decode has finished. WaitForEngineToIdle will wait the specified time for the Engine to idle; check the return value to ensure the engine is idle, indicating that decode results are available.
WaitForEngineToIdle is also useful to ensure the Engine has finished initializing, prior to calls to Decode.
Complete Help Topic List | Speech Engine Product Information