2150关注6792浏览
<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() //此处有时候无效果,录音停止不下来。
}
-
至过去的我
2044人对此回答表示赞同
我是未来的你,你现在是不是在年找寻小程序答案。你不要感觉诧异,给你来信原因,就是让你不在后悔。今天去学习如何推广小程序,相信......点击查看更多> -
Lucas
6人对此回答表示赞同
我是这样做的,但是依然是无效的
展开63回复分享发布于 6年前评论(3)
收起评论
大佬,请教,小米手机的input组件,在调出键盘时,页面不滚动(所以就遮住了input输入框,看不到输入的内容),这个bug要怎么解决?
还是谢谢你的回答,下班了,明天继续。
不好意思,刚刚我的回答不对。根据文档,wx.getRecorderManager()是获取全局唯一的录音管理器。