LV_SRE_WaitForDecode

Blocks the client application until the decode is finished.

Functions

Parameters

hport

The port's handle.

VoiceChannel

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

Return Values

LV_SUCCESS

No errors. The decode is finished.

LV_INVALID_HPORT

The input hport is not a valid one.

LV_INVALID_SOUND_CHANNEL

The input VoiceChannel is not a valid one.

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.

LV_EXCEPTION

An exception occured while processing the request.

Remarks

Some of the API functions run asynchronously, in particular, LV_SRE_Decode. LV_SRE_WaitForDecode 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_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.

To wait upto a specific amount of time less than PROP_EX_DECODE_TIMEOUT use LV_SRE_WaitForEngineToIdle where one of the input parameters is the time to wait.

See Also

© 2012 LumenVox LLC. All rights reserved.