ASREvents
Add the following line to your scenario code to use the events:
require(Modules.ASR);
Constants
ASRError
The event is triggered in case of problems during the recognition process
Parameters
asr:
ASR instance that generated the event
error:
string
Error message
CaptureStarted
The event is triggered after ASR detected voice input and started collecting audio data for ASR
Parameters
asr:
ASR instance that generated the event
InterimResult
The event is triggered when interim recognition result received from ASR. Note that event could be triggered only if the ASRParameters.interimResults option was set to true.
Parameters
asr:
ASR instance that generated the event
text:
string
Recognition result
Result
The event is triggered when recognition result received from ASR. We strongly recommend to create recognition timeout manually to prevent unexpectedly long recognition time.
Parameters
asr:
ASR instance that generated the event
channelTag:
number
For multi-channel audio, this is the channel number corresponding to the recognized result for the audio from that channel.
confidence:
number
Recognition confidence in 0..100 Range (100 means full confidence, 0 - not confident at all)
languageCode:
string
Output only. The BCP-47 language tag of the language in this result. This language code was detected to have the most likelihood of being spoken in the audio.
resultEndTime:
number
Time offset of the end of this result relative to the beginning of the audio.
text:
string
Recognition result
SpeechCaptured
The event is triggered after ASR captured audio data, before recognition process
Parameters
asr:
ASR instance that generated the event
Started
The event is triggered after ASR instance was created
Parameters
asr:
ASR instance that generated the event