appid: wxa67ed20624f94c25 代码片段: recordStart: function () { console.log("Enter"); var that = this; this.setData({ recordingClass: 'recording', }); //记录录音开始的时间 this.startTime = new Date(); const recorderManager = wx.getRecorderManager(); const options = { duration: 10000, sampleRate: 44100, numberOfChannels: 1, encodeBitRate: 192000, format: 'mp3', frameSize: 50 } recorderManager.onStart(() => { console.log("record start"); }); recorderManager.start(options); // wx.startRecord({ // success: function (res) { // //记录录音时长 // console.log("Record succeed"); // var diff = (that.endTime - that.startTime) / 1000; // diff = Math.ceil(diff); // that.submitVoiceCommemt({ url: res.tempFilePath, timeLen: diff }); // }, // fail: function (res) { // console.log("Record failed"); // }, // complete: function (res) { // console.log("Record completed"); // }, // }); }, 这是这个函数的部分代码,我是根据官方的文档写的,但是一旦我将小程序以绑定appid的方式打开, 回调函数recorderManager.OnStart()无法使用,另外我也尝试着用wx.startRecord(), 并且我用了object参数(注释部分),但是 success:function(res)不会被调用,永远都是fail,不知道是不是小程序需要录音授权的问题 我给出代码片段哈,刚刚弄的 <a href="wechatide://minicode/yPCpczmH6qZ5" target="_blank">wechatide://minicode/yPCpczmH6qZ5</a>(无appid,能正常运行) <a href="wechatide://minicode/WiCnczmx6AZS" target="_blank">wechatide://minicode/WiCnczmx6AZS</a>(有appid,不能正常运行)
录音和Appid相关问题在写录音相关组件的时候,如果我是无appid的话我可以正常运行,但是我一旦在我的小程序绑定了appid,我的录音组件无法使用
2018-05-21