Re: Processing stereo data?
Re: Processing stereo data?
- Subject: Re: Processing stereo data?
- From: Brian Willoughby <email@hidden>
- Date: Wed, 09 Mar 2011 00:42:38 -0800
Rick,
If you carefully read the headers for the example classes, you'll
note that they're intended for AUs that have the same number of
inputs as outputs. Since you are creating a stereo-to-mono effect,
you should avoid subclassing the code that is designed only for mono-
to-mono or stereo-to-stereo, et cetera. Read all of the comments in
AUBase.* AUEffectBase.* and AUInlineEffectBase.*, among others.
There are fairly clear instructions there with regard to the number
of channels being different on input versus output, and you should
follow the recommendations as to which method to override.
It's a bit more difficult because there isn't an example of the M-to-
N effect, and there are some unfortunate design choices where the
common class is missing a few handy routines that you'll have to copy
over from the N-to-N class, but it's doable.
As for using the last few samples to generate the next one, that
means you have "state." This must be stored in your class variables
so that the live between buffers. For the sake of speed, these state
variables are usually copied to local register variables so that they
can be accessed quickly during the loop over your input and output
buffers, and then at the end of your loop the class variables should
be updated with the final values of the register variables. Of
course, you don't have to optimize your code like this, but it
shouldn't hurt.
Brian Willoughby
Sound Consulting
On Mar 8, 2011, at 23:57, Rick Mann wrote:
Thanks, Joe, that's very helpful. Not only do I have to process
both channels together simultaneously, I also need to use the last
few samples, to generate the next one, and I'm not sure how to do
that across invocations (other than just storing the last samples
from the previous invocation. Oh, and I need to produce mono
output, but that will hopefully be more straightforward.
Thanks for showing me ProcessBufferLists(). That'll help.
Am 09.03.2011 um 05:12 schrieb Rick Mann:
I'm working through the Audio Unit Programming Guide Simple Effect
tutorial. I've created an Audio Unit Effect from Xcode 2.3.5
stationery.
The comments in the Process() method say that num channels is
always 1, and that it requires non-interleaved format for all
inputs and outputs.
But then when they advance the input sample pointer by
inNumChannels (which is 1), the comment says "stereo, we're
advancing 2 samples".
In any case, my effect only gets one channel. How can I work with
stereo data? Is that covered later in the tutorial?
_______________________________________________
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