Javascript CognitiveServices.SpeechSynthesizer在聊天机器人中同时表示用户和机器人
大家好,我正在用MicrosoftBot框架构建一个聊天机器人,我想启用语音合成器,但只针对机器人的答案 要启用该演讲,我有以下选项Javascript CognitiveServices.SpeechSynthesizer在聊天机器人中同时表示用户和机器人,javascript,node.js,botframework,bots,Javascript,Node.js,Botframework,Bots,大家好,我正在用MicrosoftBot框架构建一个聊天机器人,我想启用语音合成器,但只针对机器人的答案 要启用该演讲,我有以下选项 // use browser built in capabilities for TTS/STT const speechOptions = { speechRecognizer: new this.CognitiveServices.SpeechRecognizer({ subscriptionKey: speechRecognizerKey }), s
// use browser built in capabilities for TTS/STT
const speechOptions = {
speechRecognizer: new this.CognitiveServices.SpeechRecognizer({ subscriptionKey: speechRecognizerKey }),
speechSynthesizer: new this.CognitiveServices.SpeechSynthesizer({
gender: this.CognitiveServices.SynthesisGender.Female,
subscriptionKey: speechSynthesizerKey,
voiceName: 'Microsoft Server Speech Text to Speech Voice (en-US, JessaRUS)'
})
};
然后我将语音选项传递给bot启动配置
// BotChat is exposed by the botchat.js
// When we run this line, the botchat.js has to be loaded in the page.
this.BotChat.App({
bot: bot,
locale: params['locale'],
resize: 'detect',
botConnection: botConnection,
speechOptions: speechOptions,
user: user
}, document.getElementById('BotChatGoesHere'));
所以我的问题是,我能给机器人框架提供什么选项,让它只回答问题而不回答我正在做的问题吗?我不太理解你的请求,因为在我这方面,我需要单击麦克风图标向机器人讲话,然后网络聊天将通过语音响应。使用通用代码,创建的机器人只是一个回声机器人,回复用户所说的内容。你能澄清你所说的“同时说用户和机器人”是什么意思吗?你的意思是,如果你对着麦克风说“Hello Echo Bot”,它会说“Hello Echo Bot你说Hello Echo Bot”吗?或者它只是简单地说“你说过”以及用户对它说了什么?