关于小程序录音接口onFrameRecorded的问题请教
请问小程序录音接口中的回调函数onFrameRecorded所返回的分片数据是什么数据,原始码流吗,带不带头部?我的是使用aac格式的,谢谢!
4 回复
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) |
//这里的分片究竟是什么数据?AAC裸流吗? //还有我保存下来之后查看二进制数据,发现每次开头都是一样的 //00 d0 00 07 00 d0 40 07,不知道是什么意思 recorderManager.onFrameRecorded((res) => { const { frameBuffer } = res console.log( 'frameBuffer.byteLength' , frameBuffer.byteLength) }) |