The recog_start instruction queues a recognizer for starting.
Synopsis
#include < irDefines.h >
recog_start(type.recognizer, type.recog_type, type.while_prompting)
Description
The recog_start instruction queues a recognizer for staring at the next invocation of getinput. The argument type.recognizer specifies the recognizer to queue. Valid values are IRD_WHOLE_WORD, IRD_PROXY_DPR, IRD_PROXY_ASR4, IRD_PROXY_ASR5, IRD_PROXY_ASR6, IRD_PROXY_ASR7, IRD_PROXY_ASR8, or IRD_PROXY_ASR9, as defined in irDefines.h.
The argument for a speech resource, type.recog_type specifies the type of recognition to use with this recognizer. For example, a grammar taken from /att/include/sr_grammar.h.
The argument type.while_prompting if true (1), indicates to queue the recognizer to be started before the prompt begins. If false (0), indicates to queue the recognizer to be started after the prompt completes. Note that the echo canceler must have been started earlier using sr_talkoff to recognize while prompting. If the echo canceler is not running, the recognizer is not started until after the prompt completes regardless of the value of type.while_prompting.
Return values
The return value from recog_start is placed in r.0 as follows:
0 |
Recognizer has successfully queued for starting. |
-1 |
Maximum number of recognizers are already queued. |
-2 |
Recognizer has been disabled using a prior call to recog_cntl. |
Examples
Speech example: The following example illustrates the construction of a prompt that requests the caller to enter a 4 digit number. Caller input is accepted as touch-tone, dial-pulse, or speech. Note that it is not necessary to queue the touch-tone recognizer since it is implicitly always on.
talk ("enter your 4 digit PIN")
recog_start(IRD_WHOLE_WORD, US_4dig, 1)
getinput(ch.ATTNUM, 4, int.RECOGNIZER, int.MODE)
See also