ASRParameters
ASR parameters Add the following line to your scenario code to use the interface:
require(Modules.ASR);
Props
alternativeLanguageCodes
alternativeLanguageCodes: string[]
v1p1beta1 Speech API feature. A list of up to 3 additional BCP-47 language tags, listing possible alternative languages of the supplied audio. See Language Support for a list of the currently supported language codes.
Requires the beta parameter set to true
; works for Google profiles only.
beta
beta: boolean
Use or not the Google v1p1beta1 Speech API, e.g., enableSeparateRecognitionPerChannel, alternativeLanguageCodes, enableWordTimeOffsets, etc.
diarizationConfig
diarizationConfig: {enableSpeakerDiarization: boolean}
v1p1beta1 Speech API feature. Config to enable speaker diarization and set additional parameters to make diarization better suited for your application.
See the full list of available fields here.
Requires the beta parameter set to true
; works for Google profiles only.
enableAutomaticPunctuation
enableAutomaticPunctuation: boolean
v1p1beta1 Speech API feature. If true, adds punctuation to recognition result hypotheses. This feature is only available in select languages. Setting this for requests in other languages has no effect at all. The default false value does not add punctuation to result hypotheses.
Requires the beta parameter set to true
; works for Google profiles only.
enableSeparateRecognitionPerChannel
enableSeparateRecognitionPerChannel: boolean
v1p1beta1 Speech API feature. The recognition result will contain a field to state which channel that result belongs to. If this is not true, only the first channel will be recognized.
Requires the beta parameter set to true
; works for Google profiles only.
enableWordConfidence
enableWordConfidence: boolean
v1p1beta1 Speech API feature. If true, the top result includes a list of words and the confidence for those words. If false, no word-level confidence information is returned. The default is false.
Requires the beta parameter set to true
; works for Google profiles only.
enableWordTimeOffsets
enableWordTimeOffsets: boolean
v1p1beta1 Speech API feature. If true, the top result includes a list of words and the start and end time offsets (timestamps) for those words. If false, no word-level time offset information is returned. The default is false.
Requires the beta parameter set to true
; works for Google profiles only.
interimResults
interimResults: boolean
Enables/disables interim ASR results. If it is "true", the ASREvents.InterimResult will be triggered many times according to the speech.
metadata
metadata: {microphoneDistance: string}
v1p1beta1 Speech API feature. Metadata regarding this request.
See the full list of available fields here.
Requires the beta parameter set to true
; works for Google profiles only.
model
model:
Recognition model. Select the model best suited to your domain to get the best results. If it's not specified, the DEFAULT model is used.
phraseHints
phraseHints: string[]
Preferable words to recognize. Supported by the Google profile only. Note that phraseHints do not limit the recognition to the specific list. Instead, words in the specified list will have a higher chance to be selected.
profanityFilter
profanityFilter: boolean
If set to true, the server will attempt to filter out profanities, replacing all but the initial character in each filtered word with asterisks, e.g. "f***". If set to false or omitted, profanities won't be filtered out.
singleUtterance
singleUtterance: boolean
Enables/disables single utterance. It is true by default, so the ASREvents.Result will be triggered after every utterance. If it is false, there are two cases: 1) if the speech is shorter than 60 sec, ASREvents.Result will be triggered in unpredictable time. You could mute the mic when the speech is over - this will increase the probability of ASREvents.Result catching 2) if the speech is longer than 60 sec, ASREvents.Result will be triggered each 60 seconds
speechContexts
speechContexts: {boost: number, phrases: string[]}
Increase the recognition model bias by assigning more weight to some phrases than others. Phrases is the word array, boost is the weight in the range of 1..20.