-2

As per Microsoft docs, we can configure Web-Chat component to use our own custom speech recognition as below

const speechOptions = {
    speechRecognizer: new YourOwnSpeechRecognizer(),
    speechSynthesizer: new YourOwnSpeechSynthesizer()
  };

How can I implement "YourOwnSpeechRecognizer" in JAVASCRIPT ??

Nicolas R
  • 13,812
  • 2
  • 28
  • 57
mamhh
  • 85
  • 1
  • 9

1 Answers1

0

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.

Mohit Verma
  • 5,140
  • 2
  • 12
  • 27