真机上wx.getRecorderManager().start()录音报错
调用 wx.getRecorderManager().start() 开始录音, onError得到错误信息:errMsg: opreateRecorder fail: start record fail. 此报错在真机调试时会出现,在小程序开发工具里不会出现。真机上确定已经开通了录音权限。 调用代码如下: if(wx == undefined || wx) { console.log("record onLoad...") var obj = {} obj.sampleRate = 8000 obj.encodeBitRate = 16000 obj.numberOfChannels = 1 obj.format = "acc" obj.frameSize = 0.1 wx.getRecorderManager().start(obj) console.log("record start...") wx.getRecorderManager().onStart( function () { console.log("record started...") }.bind(this) ) wx.getRecorderManager().onError( function (errMsg) { console.log("error...", errMsg) }.bind(this) ) wx.getRecorderManager().onFrameRecorded( function (frameBuffer,isLastFrame) { console.log("record...") }.bind(this) ) }