【发布时间】:2020-07-30 15:08:11
【问题描述】:
我正在尝试构建一个印地语(hi-IN)语音聊天机器人..该机器人在网络聊天中以英语工作,但任何人都可以帮助我如何让机器人了解我说的是印地语,然后它会被转换使用认知语音服务转换成印地语文本
<script>
(async function () {
const res = await fetch('https://directline.botframework.com/v3/directline/tokens/generate', {
method: 'POST',
headers: new Headers({
'Authorization': 'Bearer 5********'
})
});
const { token } = await res.json();
const store = window.WebChat.createStore(
{},
({ dispatch }) => next => action => {
if (action.type === 'DIRECT_LINE/CONNECT_FULFILLED') {
dispatch({
type: 'WEB_CHAT/SEND_EVENT',
payload: {
name: 'webchat/join',
value: { username: "UserName" }
}
});
}
return next(action);
}
);
window.WebChat.renderWebChat({
directLine: window.WebChat.createDirectLine({ token }),
webSpeechPonyfillFactory: window.WebChat.createBrowserWebSpeechPonyfillFactory(),
styleOptions: {
hideUploadButton: true,
bubbleBackground: '#cccccc',
bubbleBorder: 'solid 1px #E6E6E6'
},
store
}, document.getElementById('webchat'));
document.querySelector('#webchat > *').focus();
})().catch(err => console.error(err));</script>
```
【问题讨论】:
-
您的问题解决了吗?
-
@ranusharao 是的
标签: c# botframework speech-recognition direct-line-botframework web-chat