render callback: To memclear or not to memclear; that is the question...
render callback: To memclear or not to memclear; that is the question...
- Subject: render callback: To memclear or not to memclear; that is the question...
- From: uɐıʇəqɐz pnoqɥɒɯ <email@hidden>
- Date: Thu, 17 Jun 2010 02:44:13 -0700
Hi. In Apple's samples, I see that they zero out the bytes in the output buffer, like so:
for (UInt32 i=0; i < inData->mNumberBuffers; i++)
memset(inData->mBuffers[i].mData, 0, inData->mBuffers[i].mDataByteSize);
What I'd like to know is whether I can accomplish the same end-result by just doing so:
ioData->mBuffers[0].mDataByteSize = 0;
with or without:
*ioActionFlags |= kAudioUnitRenderAction_OutputIsSilence;
It seems to me that in the iPhoneMixerEQGraphTest sample, when the data in the source buffer isn't sufficient to satisfy the requested inNumberFrames, the following statement:
if (offset < numFramesToRender) {
numFramesToRender -= offset;
ioData->mBuffers[0].mDataByteSize = numFramesToRender * userData->soundBuffer[inBusNumber].asbd.mBytesPerFrame;
}
(where numFramesToRender is a smaller number than inNumberFrames)
seems to satisfy the caller, and no noise is heard despite the buffer being returned is smaller than requested.
Am I right, or am I missing something?
http://developer.apple.com/iphone/library/samplecode/iPhoneMixerEQGraphTest/Listings/Classes_AUGraphController_mm.html _______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden