- 微信同声传译插件onRecognize方法不执行,已经有很多问答了,辛苦官方回答下吧
initRecord() { console.log(manager); //有新的识别内容返回,则会调用此事件 manager.onRecognize = (res) => { console.log('onRecognize: ', res.result); this.setData({ recordStatus: RECORD_STATUS.ING, activeText: res.result, activeTip: '点击下方停止录音' }); if (recordTimer) { recordTimer = null; } setTimeout(() => { console.log('handle streamRecordEnd'); this.streamRecordEnd(); }, 2000); }; // 识别结束事件 manager.onStop = (res) => { let activeText = res.result; console.log('manager.onStop: ', activeText); if(activeText == '') { activeText = '抱歉,没听清'; activeTip = '点击下方再说一遍吧'; } this.setData({ recordStatus: RECORD_STATUS.NORMAL, activeText, activeTip: '' }); }; // 识别错误事件 manager.onError = (res) => { this.setData({ recordStatus: RECORD_STATUS.NORMAL, activeText: '抱歉,没听清', activeTip: '点击下方重新发起语音搜索' }); } },
2023-10-09 - 微信同声传译插件不进onRecognize的方法
[图片] 前段时间还好着,代码也没动过,现在这个方法怎么都不进
2023-01-13