• 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: More of Process
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: More of Process


  • Subject: Re: More of Process
  • From: philippe wicker <email@hidden>
  • Date: Fri, 4 Nov 2005 15:36:06 +0100


On Nov 3, 2005, at 11:29 PM, john smith wrote:

void AU::AUKernel::Process
[skip]
     sourceP += inNumChannels;    // advance to next frame (e.g. if stereo, >we're advancing 2 samples);
[skip]
But... inNumChannels is always 1 we're told. So, what's happening in the stereo case?

A bit of history here...... The AU specs define a "native" format that every "normal" AU is expected to provide on any output bus and to receive on any input bus. By "normal" AU I mean an AU which is not a HAL InputAU (these ones are a special family intended to simplify the management of an audio device). Originally - ie for V1 AU - the native format was 32 bit interleaved float. V1 AU are now deprecated and replaced by V2 AU for which the native format is 32 bit *NON* interleaved float. The Kernel class is there to provide a basic mechanism for n:n AU, ie same number of channels on input and output busses. The code executed before the call to AU::AUKernel::Process() - in AUEffectBase::ProcessBufferLists() - separate channels wether they are part of an interleaved or non interleaved stream (ie wether your AU is V1or V2) and allows your code to process channels independently. 

Within CoreAudio, audio stream data are passed around  using the 'AudioBufferList' structure:

struct AudioBufferList
{
    UInt32      mNumberBuffers;
    AudioBuffer mBuffers[kVariableLengthArray];
};

which had to be used in a consistent way in a V1 or V2 world. In V1 world, an AudioBufferList contains one AudioBuffer (mNumberBuffers = 1) made of a number of n Float32 frames for  an interleaved n channels stream.  In V2 world, an AudioBufferList contains n AudioBuffer (mNumberBuffers = n) made of a number of 1 Float32 "frames" for  a non interleaved n channels stream.  The 'inNumChannels' parameter passed to AU::AUKernel::Process() refer to the number of Float32 samples in a frame, that is 'n' for the V1 case (interleaved), and 1 for the v2 case (non interleaved). It is the copy of the AudioBuffer::mNumberChannels field. In other words, 'inNumChannels' is the number of interleaved channels in an AudioBuffer.

Finally, what's the ioSilence parameter for?

It's a hint for an AU inserted in a chain. It tells it that the audio processing may be skipped or simplified at some point when AUs located before  in the effect chain are providing null audio.

 _______________________________________________
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: More of Process
      • From: "john smith" <email@hidden>
References: 
 >More of Process (From: "john smith" <email@hidden>)

  • Prev by Date: Re: Channels and frames
  • Next by Date: Re: More of Process
  • Previous by thread: Re: OT: Class-compliant multiport MIDI interface?
  • Next by thread: Re: More of Process
  • Index(es):
    • Date
    • Thread