This function passes a string of digits delimited by whitespace through an active voice grammar and provides a semantic interpretation. Instead of performing speech recognition on audio, this function is used only to evaluate the semantic interpretation of a string of digits against DTMF grammars.
Note that this function does not actually process DTMF -- that is the responsibility of a telephony platform. Its input must be a string of digits, not raw DTMF tones.
Function
- int DTMFDecode(const char* dtmf_str, unsigned int flags)
Parameters
dtmf_str
A space separated string that may contain the numbers from 0-9, the * sign, or the # sign. This is the string for which you want a semantic interpretation.
flags (bitwise OR flags to set desired options)
Unused in the current implementation.
Return Values
Non-negative number
No errors.
LV_INVALID_BUFFER
Indicates that dtmf_str is NULL or of 0 length.
LV_INVALID_HPORT
The port is not valid (either CreateClient has not been called or DestroyClient has been called prior to this call).
LV_FAILURE
This grammar could not be activated, because the port was shutting down.
LV_LICENSES_EXPIRED
Indicates that the license acquired for the decode operation does not permit the use of the current version of the ASR server.
LV_GRAMMAR_LOADING_ERROR
Indicates an error in using an active grammar for the decode operation (eg: there were no words in the compiled grammar).
LV_NO_SERVER_AVAILABLE
Indicates that no ASR servers were available to perform the decode.
LV_TIME_OUT
Indicates that the preceeding decode operation timed out.
LV_EXCEPTION
An exception occurred while processing the request.
Remarks
The interpretation is stored in a voice channel called LV_DTMF_CHANNEL. Similar to the Decode function, you may get the interpretation by using GetInterpretationData and GetInterpretationString. You can also callGetNumberOfInterpretations and GetNumberOfParses.
On an error, call ReturnErrorString with the negative result from DTMFDecode to get a description of the error.
See Also