<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() //此处有时候无效果,录音停止不下来。
}
我是这样做的 ,但是依然是无效的![]()
不好意思,刚刚我的回答不对。根据文档,wx.getRecorderManager() 是获取全局唯一的录音管理器。
你可以提供一下代码片段吗,我在我这里试一下看看。
https://developers.weixin.qq.com/miniprogram/dev/api/getRecorderManager.html
还是谢谢你的回答,下班了,明天继续。
大佬 ,请教,小米手机的input组件,在调出键盘时,页面不滚动(所以就遮住了input输入框,看不到输入的内容),这个bug要怎么解决?