我貌似解决了此问题,还有无其他问题未细测。 const soePlugin = requirePlugin("soePlugin") let soeRecorderManager = soePlugin.getSoeRecorderManager 我有两个页面使用了这个,虽然我在每个页面重新监听前,清除了soeRecorderManager中的event,解决了监听多次事件重复回调的问题,但是出现了我上面描述的问题。我尝试将上面的代码抽离到一个地方,将soeRecorderManager存在app.globalData中,用的时候直接使用,就解决了上面的问题,记录在这里,希望能给其他同学一些帮助。
自定义组件中使用智聆语音评测插件在开发者工具中监听插件事件能正常回调,真机调试就无法回调。。。开发者工具调试有相关事件回调日志,截图:[图片] 真机调试没有相关日志,无法完成评测,截图:[图片]
2021-06-18已解决,实际上可以直接在上传方法中传参数。谢谢各位大佬的关注。 uploadLocal: function () { let data = this.data; wx.chooseMessageFile({ count: 1, type: 'file', success(res) { manager.uploadLocalFile({ content: data.content, evalMode: data.evalMode, scoreCoeff: data.scoreCoeff, serverType: data.serverType, storageMode: data.storageMode, soeAppId: data.soeAppId, textMode: data.textMode, duration: data.duration, voiceFileType: 3, timeoutData: 5000, audioBase64: wx.getFileSystemManager().readFileSync(res.tempFiles[0].path, "base64") }) } }) }
选择本地录音文件进行语音评测报错uploadLocal: function () { let content = this.data.content wx.chooseMessageFile({ count: 1, type: 'file', success(res) { let audioBase64=wx.getFileSystemManager().readFileSync(res.tempFiles[0].path, "base64"); manager.uploadLocalFile({ content: content, audioBase64: audioBase64 }) } }) } 报错: {"Error":{"Code":"InvalidParameter","Message":"Url key and value should be splited by `=`."},"RequestId":"70ed5f88-ce79-438a-ba63-71516b797e72"} 根据这个错误描述没搞明白代码哪里有问题,望指教。 补充:发现第一次上传会报这个错,第二次上传就正常了。。。 最新补充: 找到原因是:上传本地文件,未初始化值,所以报上面的错。 在上传文件前,先调用manager.start()初始化参数值是可以的,不过此方法是录音方法,如果调用此方法后,上传本地文件评测后会调用多次评测。 各位大佬知道有什么方法可以不调用manager.start()方法来初始化参数值么? manager.start({ content: this.data.content, evalMode: this.data.evalMode, scoreCoeff: this.data.scoreCoeff, serverType: this.data.serverType, storageMode: this.data.storageMode, soeAppId: this.data.soeAppId, textMode: this.data.textMode, duration: this.data.duration })
2021-05-29