【发布时间】:2018-11-09 05:14:43
【问题描述】:
我正在使用 Bot Framework 网络聊天,并且我正确设置了一个前端供用户与我的机器人聊天。我正在尝试为其启用语音,我尝试按照此处的教程进行操作:https://docs.microsoft.com/en-us/azure/bot-service/bot-service-channel-connect-webchat-speech?view=azure-bot-service-3.0
我遇到的问题是我尝试使用 Azure 语音服务,我正确设置了我的服务,并设置了密钥。但我不确定从哪里获得 CognitiveServices?本教程没有指定从哪里获得它。
这是我的代码:
<div id="bot"/>
<script src="https://cdn.botframework.com/botframework-webchat/latest/botchat.js"></script>
<script>
const speechOptionsRemote = {
speechRecognizer: new CognitiveServices.SpeechRecognizer({ subscriptionKey: '...' }),
speechSynthesizer: new CognitiveServices.SpeechSynthesizer({
gender: CognitiveServices.SynthesisGender.Female,
subscriptionKey: '...',
voiceName: 'Microsoft Server Speech Text to Speech Voice (en-US, JessaRUS)'
})
};
BotChat.App({
directLine: { secret: '...' },
user: { id: 'WebChat' },
bot: { id: '...' },
resize: 'detect',
speechOptions: speechOptionsRemote,
showUploadButton: false
}, document.getElementById("bot"));
var header = document.getElementsByClassName("wc-header");
header[0].innerHTML = "<span ><p align='center' >My Bot</p></span>"
</script>
当我导航到该页面时,它抱怨没有找到 CogntiveService。我在哪里得到它?
【问题讨论】:
-
我不确定你的意思。你到底错过了什么?能详细点吗?
-
问题是 Bing 语音已被弃用,目前还没有办法将认知服务语音密钥与 WebChat 一起使用。 WebChat 团队将很快发布更新,允许使用认知服务而不是 Bing 语音填充小马。
标签: botframework