我正在使用以下功能来渲染传入的音频。
static OSStatus audioUnitRenderCallback(void *inRefCon,
AudioUnitRenderActionFlags *ioActionFlags,
const AudioTimeStamp *inTimeStamp,
UInt32 inBusNumber,
UInt32 inNumberOfFrames,
AudioBufferList *ioData{
// App is crashing at this :
AudioUnitIO *SELF = (__bridge AudioUnitIO *)inRefCon;
// MICROPHONE: take the sound received, render it into bytes and hand them to the delegate
AudioUnitRender(SELF->g_audioUnit,
ioActionFlags,
inTimeStamp,
g_inputBus,
inNumberOfFrames,
ioData);
if (!SELF->recordingAudio) {
memset(ioData->mBuffers[0].mData, 0, ioData->mBuffers[0].mDataByteSize);
// Some other code goes here
}
如上所述,我正在接受崩溃。我错过了什么吗?