JavaScript/jQuery SpeechToText - customSpeechRecognizer

Allows you to implement custom speech recognition engines.

If you want to integrate a custom speech recognition engine, set customSpeechRecognizer.enabled to true. When you implement a custom speech recognizer, SpeechToText no longer does the following:

  • Listens to user speech.
  • Updates the component state. Set the SpeechToText state using the customSpeechRecognizer.isListening property.
  • Calls the onResult and onError handlers.

enabled

Specifies whether a custom speech recognition engine is implemented.

Type:

Boolean

Default Value: false

isListening

Indicates whether the custom speech recognition engine is listening.

Type:

Boolean

Default Value: false

Modify isListening to update the component state:

index.js
  • $('#speech-to-text').dxSpeechToText({
  • customSpeechRecognizer: {
  • enabled: true,
  • },
  • onStartClick(e) {
  • e.component.option('customSpeechRecognizer.isListening', true);
  • },
  • onStopClick(e) {
  • e.component.option('customSpeechRecognizer.isListening', false);
  • },
  • })

This property affects the SpeechToText icon (startIcon/stopIcon), text (startText/stopText), and click handler (onStartClick/onStopClick).