• 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: newbie AU questions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: newbie AU questions


  • Subject: Re: newbie AU questions
  • From: William Stewart <email@hidden>
  • Date: Tue, 11 Jul 2006 11:13:03 -0700


On 11/07/2006, at 6:30 AM, James Closs wrote:

Hi all,

I'm new to AU development (and DSP development and C++ in general!). Have been going through the AUDemo sample code and am so far having a reasonable degree of success setting up simple AUs (that almost destroy my speakers!)

I had a few questions before I start trying to do things 'properly'. I'd be grateful if anyone could answer these, or point me to the appropriate place in the docs...

1. Buffer Size
The amount of samples passed to AUDemo::AUDemoKernel::Process() seems (logically) to be the same as the audio buffer size. Is there any way of getting the audio buffer size outside of this method so that I can use it for various initiation tasks? E.g, to set up my own internal buffers at the appropriate size?

For all AUs, the Initialize call is where allocations should be performed. You can over-ride Initialize to do custom work (you'd probably want to first call AUEffectBase::Initialize just to make sure the channels are all correct, etc...) The host will set a variable on your AU before it initialises you - the max frames per slice - this value can be retrieved from an accessor method in AUBase, and it will tell you what the maximum number of sample frames a host can legally call you to process - so this is the number you should use with your allocation requirements.



2. Latency
I presume the correct way of dealing with this is the amount of 'look ahead' my plug would induce. So if the samples I'm writing are 64 samples 'behind' the ones I'm reading I report 64 samples latency. Is this a correct assumption?

Yes - (though we report latency in seconds).


3. Mono, Stero, Mono->Stereo
What exactly am I receiving in AUDemb::AUDemoKernel::Process()? If it's not an interleaved stream (the comments indicate that it's not) then how do I deal with each side of a stereo signal? How do I know (or force) whether I'm operating in mono, stero, or mono- >stereo mode?

Have a look at the code in AUEffectBase::Initialise - the host is responsible for setting formats (num channels) for an AU, and the AU in its Initialise call is responsible to ensure that these formats are supported.


You should also bare in mind that AUEffectBase is primarily designed to work with N-N channel processing. If you are going to process say Mono input to Stereo Output, then you can't use the kernels, in place processing and bypass in AUEffectBase do not work without some modification - our recommendation is to start from AUBase instead (that is what we do ourselves). My suggestion would be to ignore the mono-stereo case for the moment, and get everything sorted out by using AUEffectBase as a starting point.

Bill


I'm sure there will be many more, but that'll be enough for me to get my teeth into at the moment!


best

====

James Closs, Director, bitBull Ltd

http://www.bitbull.com

07771 991171

====

_______________________________________________
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

--
mailto:email@hidden
tel: +1 408 974 4056
________________________________________________________________________ __
"Much human ingenuity has gone into finding the ultimate Before.
The current state of knowledge can be summarized thus:
In the beginning, there was nothing, which exploded" - Terry Pratchett
________________________________________________________________________ __


_______________________________________________
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: newbie AU questions
      • From: James Closs <email@hidden>
References: 
 >newbie AU questions (From: James Closs <email@hidden>)

  • Prev by Date: Re: DRM and Apple Loops
  • Next by Date: Re: Trouble setting sub device list, with a private aggregate device
  • Previous by thread: newbie AU questions
  • Next by thread: Re: newbie AU questions
  • Index(es):
    • Date
    • Thread