javascript - CognitiveServices.SpeechSynthesizer 在聊天机器人中同时说用户和机器人
问题描述
大家好,我正在使用 MicrosoftBot 框架构建聊天机器人,我想启用语音合成器,但仅用于机器人答案。
启用语音我有这个选项
// 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)'
})
};
然后我将语音选项传递给机器人启动配置
// 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'));
所以我的问题是,我是否可以给机器人框架提供任何选项来只说出答案而不是我正在做的问题?
解决方案
推荐阅读
- android - 可展开列表视图内的列表视图
- python - decorator to generate new classes into namespace
- python - pyqt attribute error when trying to emit integer signal
- amazon-web-services - Dynamodb 可以定期检查项目吗?
- python - What is the difference between tf.keras.layers versus tf.layers?
- r - Compute raster statistics on sequential list of raster layers
- .net - VB.NET Winforms/.Net Framework 4.5.2 ListViewBox Disable Background Color
- ios - Bar button item image (UIImage) color changes with tint color?
- c++ - 传递 std::type_info 以识别 void *
- android - Gradle project sync failed after update - Unable to find method 'com.google.common.collect.ImmutableSet.toImmutableSet()Ljava/util/stream/Collector;'