收藏
回答

bind:touchend 绑定停止录音 无效果

框架类型 问题类型 API/组件名称 终端类型 微信版本 基础库版本
小程序 Bug bind:touchend wx.getRecorderManager()中的stop() 客户端 6.6.7 2.2.2

<button id='recordBtn' class="record-btn" hover-class="tapSelectBtn"  bind:touchstart='holdRecord' bind:touchend='endRecord' bind:touchmove='moveRecord' bind:touchcancel='cancelRecord'>

            <image src='../images/record-logo.png'></image>

             <text>按住说话</text>

</button>

this.setData({

    recordOptions = {

        //录音参数配置

     duration: 600000,

     sampleRate: 11025,

     numberOfChannels: 1,

     encodeBitRate: 30000,

     format: 'mp3'

    }

})

holdRecord() {

    wx.getRecorderManager().start(this.data.recordOptions)

}

endRecord() {

    console.log('123456')   //此处可以正常打印

    wx.getRecorderManager().stop()   //此处有时候无效果,录音停止不下来。

}







回答关注问题邀请回答
收藏

1 个回答

  • 天空
    天空
    2018-09-03

    我是这样做的  ,但是依然是无效的





    2018-09-03
    有用
    回复 3
    • Eric Huang
      Eric Huang
      2018-09-03

      不好意思,刚刚我的回答不对。根据文档,wx.getRecorderManager() 是获取全局唯一的录音管理器。

      你可以提供一下代码片段吗,我在我这里试一下看看。


      https://developers.weixin.qq.com/miniprogram/dev/api/getRecorderManager.html

      2018-09-03
      回复
    • 天空
      天空
      2018-09-03

      还是谢谢你的回答,下班了,明天继续。

      2018-09-03
      回复
    • 天空
      天空
      2018-09-05回复Eric Huang

      大佬 ,请教,小米手机的input组件,在调出键盘时,页面不滚动(所以就遮住了input输入框,看不到输入的内容),这个bug要怎么解决?

      2018-09-05
      回复
登录 后发表内容