Configure a recognition session
The set_options event can be used to customize the behaviour of the recognizer for the duration of the WebSockets connection. The following payload is used:
{
run_itn: boolean,
run_capitalization: boolean,
run_spoken_command_conversion: boolean,
streaming_vad_min_silence_length: float,
filter_profanities: boolean
}
See Inverse text normalization and Spoken punctuation for descriptions of inverse text normalization (ITN) and spoken command conversion.
The recogniser's inverse text normalization and spoken command conversion modules are enabled or disabled using the run_itn, run_capitalization and run_spoken_command_conversion options.
The streaming_vad_min_silence_length option controls the duration of silence required for a streaming speech segment to be considered complete, affecting streaming recognition delay and typical recognized phrase length.
The options can be modified individually, and the set_options event can be sent arbitrarily many times at any point after establishing a connection.
The event is invoked as follows:
socketLocal.emit('set_options', payload)
Any error resulting from the set_options event is communicated to the client via an error event, which may be captured as follows:
socketLocal.on('error', (data) => {
console.log('error', new Date())
errorInfo = data
})