• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
render callback: To memclear or not to memclear; that is the question...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: render callback: To memclear or not to memclear; that is the question...
      • From: William Stewart <email@hidden>
  • Prev by Date: Re: iPhone AU best practices
  • Next by Date: Controlling multiple parameters with one custom control
  • Previous by thread: Re: Deriving timing information for scheduled playback on an AUGraph
  • Next by thread: Re: render callback: To memclear or not to memclear; that is the question...
  • Index(es):
    • Date
    • Thread