This is something which you have to do:-
export interface ISpeechRecognizer {
locale: string;
isStreamingToService: boolean;
referenceGrammarId: string; // unique identifier to send to the speech implementation to bias SR to this scenario
onIntermediateResult: Func<string, void>;
onFinalResult: Func<string, void>;
onAudioStreamingToService: Action;
onRecognitionFailed: Action;
warmup(): void;
setGrammars(grammars?: string[]): void;
startRecognizing(): Promise<void>;
stopRecognizing(): Promise<void>;
speechIsAvailable(): boolean;
}
You have to provide your own custom speech recognition that implements ISpeechRecognizer.
Hope it helps.