Re: Question about mono/stereo handling in AUs
Re: Question about mono/stereo handling in AUs
- Subject: Re: Question about mono/stereo handling in AUs
- From: William Stewart <email@hidden>
- Date: Mon, 28 Sep 2009 11:04:56 -0700
On Sep 25, 2009, at 9:32 AM, Sean Costello wrote: Hi all:
I have a GUI-less Audio Unit, that is currently stereo only (stereo-in, stereo-out). The plugin sums the input to mono, and creates a stereo image out of that, so I am using ProcessBufferLists() for my render function.
Questions:
1) Right now, I specify the number of channels with the following code:
//-------------------------------------------------------------------------------- UInt32 ValhallaFreqEcho::SupportedNumChannels(const AUChannelInfo ** outChannelInfo) { static AUChannelInfo plugChannelInfo[] = { {2, 2} };
if (outChannelInfo != NULL) *outChannelInfo = plugChannelInfo;
return sizeof(plugChannelInfo) / sizeof(plugChannelInfo[0]); }
Is there anything else I need to do to prevent the plugin from being instantiated on a mono track?
No - AUEffectBase::Initialise will take your info from this call and ensure that your audio unit is only instantiated if the in and out channels are equal to 2 (you can look at this code, to get familiar with what is going on here)
2) If I want to have several different channel modes (mono-in/mono-out, mono-in/stereo-out, stereo-out/stereo-out), what is the best way of accomplishing this? Should I have several render functions that can be called from ProcessBufferLists(), and use a switch() statement to choose the desired one? Can anyone suggest a more efficient method?
The channel state is known and unchanged while you are initialised. So, you can both cache any information you frequently need once you have been initialised successfully, and that would also allow you to create appropriate rendering objects, etc, rather than having to make this decision every time you are asked to render
3) From ProcessBufferLists(), how should I be determining the input/output channel count of the calling function?
You get the stream format from your input or output element
Bill
|
_______________________________________________
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