ASREvents
Add the following line to your scenario code to use the events:
require(Modules.ASR);
Constants
ASRError
Triggers in case of errors during the recognition process.
Parameters
- asr:- ASR instance that generated the event 
- error:- string - Error message 
CaptureStarted
Triggers after ASR detected voice input and started collecting audio data for ASR.
Parameters
- asr:- ASR instance that generated the event 
InterimResult
Triggered when interim recognition result received from ASR. Note that event could be triggered only if the ASRParameters.interimResults option is set to true.
Parameters
- asr:- ASR instance that generated the event 
- text:- string - Recognition result 
Result
Triggered when a speech recognition result has been received from ASR. We strongly recommend to create recognition timeout manually to prevent unexpectedly long recognition time. Note: We recommend to take a decision about continuing speech recognition in this event's handler. Otherwise, speech recognition continues automatically.
Parameters
- asr:- ASR instance that generated the event 
- channelTag:- number Optional- Optional. For multichannel audio, this is the channel number corresponding to the recognized result for the audio from that channel. 
- confidence:- number - Recognition confidence. Depending on the ASR provider, can be in 0..100 or 0..1 range (100 or 1 means full confidence, 0 - not confident at all) 
- languageCode:- string Optional- Optional. Output only. The BCP-47 language tag of the language in this result. This language code is detected to have the most likelihood of being spoken in the audio. 
- resultEndTime:- string Optional- Optional. Time offset of the end of this result relative to the beginning of the audio. 
- text:- string - Recognition result. Depending on the ASR provider, this parameter is called text or transcript (in rare cases). 
SpeechCaptured
Triggers after ASR captured audio data, before recognition process.
Parameters
- asr:- ASR instance that generated the event 
Started
Triggers after ASR instance is created.
Parameters
- asr:- ASR instance that generated the event