微信小程序如何实时精准识别用户说话的内容?
网友回复
1、使用插件,小程序后台设置-第三方服务-插件管理中搜索微信同声传译或腾讯云智能语音,使用这个插件即可实现实时语音识别。
微信同声传译不仅能实时识别,还是实时翻译成指定国家的语音,支持文本转语音合成,关键还是免费的
const plugin = requirePlugin('WechatSI');
const manager = plugin.getRecordRecognitionManager()
manager.onStop = function(res) {
console.log("record file path", res.tempFilePath)
console.log("result", res.result)
}
manager.onStart = function(res) {
console.log("成功开始录音识别", res)
}
manager.onError = function(res) {
console.error("error msg", res.msg)
}
plugin.textToSpeech({
lang: "zh_CN",
tts: true,
content: "一个常见的需求",
...点击查看剩余70%


