Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2012/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Botframework Bot框架网络聊天&x2B;演讲+;特定声音_Botframework - Fatal编程技术网

Botframework Bot框架网络聊天&x2B;演讲+;特定声音

Botframework Bot框架网络聊天&x2B;演讲+;特定声音,botframework,Botframework,我正在尝试使用我的机器人(V4机器人和网络聊天)进行网络聊天,以使用特定的语音进行语音认知服务。我几乎按照此示例和同一文件夹中的其他示例() 等式中我唯一缺少的部分是我是否可以指定声音。我找不到如何在示例和网络聊天源代码中指定语音 这个页面链接到speech cog service docco()中,提到在SSML中指定语音,但如果可以避免的话,我不想以某种方式打开并修改由bot生成的SSML 有没有人知道这是否可能,如果可能,如何实现 谢谢 Lee好的,我看了小马填充代码后,自己找到了答案。下

我正在尝试使用我的机器人(V4机器人和网络聊天)进行网络聊天,以使用特定的语音进行语音认知服务。我几乎按照此示例和同一文件夹中的其他示例()

等式中我唯一缺少的部分是我是否可以指定声音。我找不到如何在示例和网络聊天源代码中指定语音

这个页面链接到speech cog service docco()中,提到在SSML中指定语音,但如果可以避免的话,我不想以某种方式打开并修改由bot生成的SSML

有没有人知道这是否可能,如果可能,如何实现

谢谢


Lee

好的,我看了小马填充代码后,自己找到了答案。下面是部分片段。更新语音到区域设置映射的列表,以匹配要用于指定区域设置的语音


    const speechServicesPonyfillFactory = await window.WebChat.createCognitiveServicesSpeechServicesPonyfillFactory({ authorizationToken, region });

    return options => {

        const ponyfill = speechServicesPonyfillFactory(options);

        var speechSynthesisUtterance = ponyfill.SpeechSynthesisUtterance;
        var speechSynthesis = ponyfill.speechSynthesis;

        speechSynthesis.getVoices = function () {
            return [
                { lang: 'en-US', gender: 'Male', voiceURI: 'Microsoft Server Speech Text to Speech Voice (en-US, BenjaminRUS)' }
            ];
        }

        return {
            SpeechGrammarList: ponyfill.SpeechGrammarList,
            SpeechRecognition: ponyfill.SpeechRecognition,
            speechSynthesis: speechSynthesis,
            SpeechSynthesisUtterance: speechSynthesisUtterance
        }
    };
};

...

var ponyfillFactory = await createSpeechPonyfillFactory({ authorizationToken, region });

...

// Do the usual stuff from the sample to get auth token and region...

window.WebChat.renderWebChat({
                directLine: directLine,
                webSpeechPonyfillFactory: ponyfillFactory,
                store
            }, document.getElementById('webchat'));



在哪里可以获得可用的语音列表?