ASREvents
Add the following line to your scenario code to use the events:
require(Modules.ASR);
Constants
ASRError
Triggers in case of problems 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
Triggers 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
Triggers 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
OptionalFor 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
OptionalOutput 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
OptionalTime 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 can be 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