LVSpeechPort::WaitForDecode

Blocks the client application until the decode is finished.

int WaitForDecode(int VoiceChannel);

Return Values

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 value associated with PROP_EX_DECODE_TIMEOUT was exceeded before a result was returned from the Speech Engine. The decode was dropped from the Engine, and the LVSpeechPort may now start a new decode request.

Parameters

VoiceChannel

Which voice channel to wait on.  Setting VoiceChannel equal to -1 causes a wait on all the voice channels for the port.

Remarks

Some of the API functions run asynchronously, in particular, Decode. WaitForDecode 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. WaitForDecode will wait the specified time (determined by set value of PROP_EX_DECODE_TIMEOUT) for the engine to idle; check the return value to ensure the decode interaction is finished before attempting to retrieve answers from the speech port.

See Also


Complete Help Topic List | Speech Engine Product Information