We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
录音播放文件MicSource.mm 录音回调函数中使用AudioUnitRender(...)传入的AudioBufferList应该malloc申请内存空间,然后再free().不然会造成不必要的bug!如下: static OSStatus handleInputBuffer(void *inRefCon, AudioUnitRenderActionFlags *ioActionFlags, const AudioTimeStamp *inTimeStamp, UInt32 inBusNumber, UInt32 inNumberFrames, AudioBufferList ioData) { videocore::iOS::MicSource mc =static_castvideocore::iOS::MicSource*(inRefCon);
AudioBuffer buffer; buffer.mData = NULL; buffer.mDataByteSize = 0; buffer.mNumberChannels = 2; AudioBufferList *buffers = (AudioBufferList *)malloc(sizeof(AudioBufferList)); buffers->mNumberBuffers = 1; buffers->mBuffers[0] = buffer; OSStatus status = AudioUnitRender(mc->audioUnit(), ioActionFlags, inTimeStamp, inBusNumber, inNumberFrames, buffers); if(!status) { mc->inputCallback((uint8_t*)buffers->mBuffers[0].mData, buffers->mBuffers[0].mDataByteSize, inNumberFrames); } free(buffers); return status;
}
如有错误,请指出并修改!
The text was updated successfully, but these errors were encountered:
No branches or pull requests
录音播放文件MicSource.mm 录音回调函数中使用AudioUnitRender(...)传入的AudioBufferList应该malloc申请内存空间,然后再free().不然会造成不必要的bug!如下:
static OSStatus handleInputBuffer(void *inRefCon,
AudioUnitRenderActionFlags *ioActionFlags,
const AudioTimeStamp *inTimeStamp,
UInt32 inBusNumber,
UInt32 inNumberFrames,
AudioBufferList ioData)
{
videocore::iOS::MicSource mc =static_castvideocore::iOS::MicSource*(inRefCon);
}
如有错误,请指出并修改!
The text was updated successfully, but these errors were encountered: