执行顺序分先后
pc 端打开微信小程序 onFrameRecorded 不触发?pc 端打开微信小程序 onFrameRecorded 不触发,开发工具和小程序都可以触发
11-03pc 端打开微信小程序 onFrameRecorded 不触发
电脑端 recorderManager onFrameRecorded不触发?const recorderManager = wx.getRecorderManager() recorderManager.onStart(() => { console.log('recorder start') }) recorderManager.onPause(() => { console.log('recorder pause') }) recorderManager.onStop((res) => { console.log('recorder stop', res) const { tempFilePath } = res }) recorderManager.onFrameRecorded((res) => { const { frameBuffer } = res console.log('frameBuffer.byteLength', frameBuffer.byteLength) }) const options = { duration: 10000, sampleRate: 44100, numberOfChannels: 1, encodeBitRate: 192000, format: 'aac', frameSize: 50 } recorderManager.start(options) 官方文档的示例代码就不行,安卓ios可以,pc不行
07-11pc 端微信小程序 onFrameRecorded 不触发
微信小程序recorderManager onFrameRecorded没有触发请教一个问题,在做微信录音的时候想尝试下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) 不管是用开发工具,还是用手机测试,都没有相应的反应。很是惆怅啊。大家可以指点下吗?
07-11