音频录制报错
发布于 5 年前 作者 chenqiang 19547 次浏览 来自 问答

touchdown: function () {

   // 开始录音

   this.setData({

     isSpeaking: true,

   })

   that.speaking.call();

   recorderManager.onStop((res) => {

     var tempFilePath = res.tempFilePath;

     that.data.filePath = tempFilePath;

     that.voiceToChar();

   })

   recorderManager.onError((res) => {

     console.log(res)

     wx.showModal({

       title: ‘录音失败’,

       content: ‘换根手指再试一次!’,

       showCancel: false,

       confirmText: ‘确定’,

       confirmColor: ‘#09BB07’,

     })

   })

   const options = {

     duration: 60000,

     sampleRate: 16000,

     numberOfChannels: 1,

     format: ‘mp3’

   }

   recorderManager.start(options)

 },

程序一直走在 recorderManager.onError   如果换个微信appid功能又没问题,看了下小程序后台也没说有地方设置禁用音频的地方啊。

1 回复

提供一下出现问题的机型和微信版本,以及能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。

回到顶部