More of Process
More of Process
- Subject: More of Process
- From: "john smith" <email@hidden>
- Date: Thu, 03 Nov 2005 23:29:54 +0100
Hi,
as I mentioned in a previous letter I'm unable to locate any documentation
for the kernel Process, except that "this is where you process the audio".
Looking in the only AU sample I could find on Apples site ("FilterDemo"), I
have this info:
______
void FilterKernel::Process( const Float32 *inSourceP,
Float32 *inDestP,
UInt32 inFramesToProcess,
UInt32 inNumChannels, // for version 2 AudioUnits
inNumChannels is always 1
bool & ioSilence)
______
and the code generated by the xcode template (which I use as a base), shows
me (approx). this:
______
void AU::AUKernel::Process( const Float32 *inSourceP,
Float32 *inDestP,
UInt32
inFramesToProcess,
UInt32 inNumChannels,
// for version 2 AudioUnits inNumChannels is always 1
bool &ioSilence )
{
UInt32 nSampleFrames = inFramesToProcess;
const Float32 *sourceP = inSourceP;
Float32 *destP = inDestP;
while (nSampleFrames-- > 0) {
Float32 inputSample = *sourceP;
//The current (version 2) AudioUnit specification *requires*
//non-interleaved format for all inputs and outputs. Therefore
inNumChannels is always 1
sourceP += inNumChannels; // advance to next frame (e.g. if stereo, we're
advancing 2 samples);
// we're only processing one of an arbitrary number of interleaved
channels
// here's where you do your DSP work
Float32 outputSample = inputSample * gain;
*destP = outputSample;
destP += inNumChannels;
}
}
______
So...
inNumChannels is always 1...
sourceP += inNumChannels; // advance to next frame (e.g. if stereo,
>we're advancing 2 samples);
But... inNumChannels is always 1 we're told. So, what's happening in the
stereo case? Obviously we're not advancing 2 samples
Also
//The current (version 2) AudioUnit specification *requires*
//non-interleaved format for all inputs and outputs. Therefore
inNumChannels is always 1
is followed by
// we're only processing one of an arbitrary number of interleaved channels
which seems to indicate that the specification requires non-interleaved
format, but it's still interleaved...???
Looking at the code it seems pretty obvious that the data is interleaved,
but I just can't get that to make sense with the notes surrounding the code.
Also, what about data for bus 1. If I have, say, 2,2 on bus 0 and 2.0 on bus
1, will I get data this way:
bus0Channel0Sample0, bus0Channel1Sample0, bus1Channel0Sample0,
bus1Channel1Sample0, bus0Channel0Sample1, bus0Channel1Sample1 etc...?
Finally, what's the ioSilence parameter for? It's seems to be ignored by
both the template and the FilterDemo sample.
Thanks,
Michael Olsen
_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar get it now!
http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/
_______________________________________________
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