请教一个问题,微信小店手机端无法打开一直显示加载失败 微信小程序开发教程。在做微信录音的时候想尝试下onFrameRecorded边录边分析的功能,可是demo代码一直没有触发onFrameRecorded回调。代码就是copy官方的实例,一点改动都没有
const recorderManager = wx.getRecorderManager()
recorderManager.onStart(() => {
console.log('recorder start')
})
recorderManager.onResume(() => {
console.log('recorder resume')
})
recorderManager.onPause(() => {
console.log('recorder pause')
})
recorderManager.onStop((res) => {
const { tempFilePath } = res
t.uploadAudio(tempFilePath)
})
recorderManager.onFrameRecorded((res) => {
const { frameBuffer } = res
alert(1)
console.log('frameBuffer.byteLength', frameBuffer.byteLength)
})
const options = {
duration: 5000,
sampleRate: 44100,
numberOfChannels: 1,
encodeBitRate: 192000,
format: 'mp3',
frameSize: 50
}
recorderManager.start(options)
不管是用开发工具,还是用手机测试,都没有相应的反应。很是惆怅啊。大家可以指点下吗?
本文网址:http://www.91bianli.com/kaifazhinan/70597.html