Angular SpeechToText - customSpeechRecognizer
Allows you to implement custom speech recognition engines.
Type:
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:
Default Value: false
isListening
Indicates whether the custom speech recognition engine is listening.
Type:
Default Value: false
Modify isListening to update the component state:
app.component.html
app.component.ts
- <dx-speech-to-text
- (onStartClick)="handleStartClick($event)"
- (onStopClick)="handleStopClick($event)"
- >
- <dxo-speech-to-text-custom-speech-recognizer
- [enabled]="true"
- ></dxo-speech-to-text-custom-speech-recognizer>
- </dx-speech-to-text>
- import { DxSpeechToTextComponent, type DxSpeechToTextTypes } from 'devextreme-angular/ui/speech-to-text';
- // ...
- export class AppComponent {
- handleStartClick(e: DxSpeechToTextTypes.StartClickEvent) {
- e.component.option('customSpeechRecognizer.isListening', true);
- }
- handleStopClick(e: DxSpeechToTextTypes.StopClickEvent) {
- e.component.option('customSpeechRecognizer.isListening', false);
- }
- }
This property affects the SpeechToText icon (startIcon/stopIcon), text (startText/stopText), and click handler (onStartClick/onStopClick).