• 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
Re: render callback: To memclear or not to memclear; that is the question...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: render callback: To memclear or not to memclear; that is the question...


  • Subject: Re: render callback: To memclear or not to memclear; that is the question...
  • From: William Stewart <email@hidden>
  • Date: Thu, 17 Jun 2010 11:29:34 -0700

On Jun 17, 2010, at 2:44 AM, uɐıʇəqɐz pnoqɥɒɯ wrote:

> 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;

no

it is also good to set the silence flag though

>
> 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:

That isn't how audio units work. You are REQUIRED to provide the requested number of samples, no more and no less.

>
>        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

 _______________________________________________
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: uɐıʇəqɐz pnoqɥɒɯ <email@hidden>
References: 
 >render callback: To memclear or not to memclear; that is the question... (From: uɐıʇəqɐz pnoqɥɒɯ <email@hidden>)

  • Prev by Date: AUMonotimbralInstrumentBase (synthesiser) best design practices
  • Next by Date: Re: Controlling multiple parameters with one custom control
  • Previous by thread: render callback: To memclear or not to memclear; that is the question...
  • Next by thread: Re: render callback: To memclear or not to memclear; that is the question...
  • Index(es):
    • Date
    • Thread