Blocks the client application until the port is idle (not decoding).
int LV_SRE_WaitForEngineToIdle(HPORT hport, int MillisecondsToWait, int VoiceChannel);
Zero (0) or greater indicates success. The Engine is now idle.
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 for. A value of -1 waits on all the voice channels for the port.
Some of the LV_SRE functions run asynchronously, in particular, LV_SRE_Decode. LV_SRE_WaitForEngineToIdle is primarily useful when LV_SRE_Decode is called without LV_DECODE_BLOCK. In this case, LV_SRE_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 LV_SRE_Decode has finished. LV_SRE_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.
LV_SRE_WaitForEngineToIdle is also useful to ensure the Engine has finished initializing, prior to calls to LV_SRE_Decode.
Complete Help Topic List | Speech Engine Product Information