热门将MS Web-Chat组件与Google-Speech-To-Text API集成?

问题描述 投票:-2回答:1

根据Microsoft文档,我们可以将Web-Chat组件配置为使用我们自己的自定义语音识别,如下所示

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

如何在JAVASCRIPT中实现“YourOwnSpeechRecognizer”?

javascript botframework microsoft-cognitive google-speech-api
1个回答
0
投票

这是你必须要做的事情: -

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;
}

您必须提供自己的自定义语音识别,以实现ISpeechRecognizer。

希望能帮助到你。

© www.soinside.com 2019 - 2024. All rights reserved.