AU Render() and multi-out MusicDevice
AU Render() and multi-out MusicDevice
- Subject: AU Render() and multi-out MusicDevice
- From: Malcolm Haylock <email@hidden>
- Date: Thu, 30 Sep 2004 16:48:18 +0100
Hi All,
I'm having troubles with a prerelease of a popular AU host and an
8-out AU instrument.
A simple Render routine to create silence is as follows. Note that
fNumOutputs is 8.
ComponentResult xxx::Render(
AudioUnitRenderActionFlags& ioActionFlags,
const AudioTimeStamp& inTimeStamp,
UInt32 sampleFrames )
{
float* outs[fNumOutputs];
// Get output buffer list and extract the i/o buffer pointers.
if (fNumOutputs>0)
{
AudioBufferList& asOutBufs=GetOutput(0)->GetBufferList();
for (long o=0; o<fNumOutputs; ++o){
outs[o]=(float*)(asOutBufs.mBuffers[o].mData);
if(asOutBufs.mBuffers[o].mDataByteSize<=0 || o>=asOutBufs.mNumberBuffers)
outs[o]=nil;
}
}
// silence
for (long o=0; o<fNumOutputs; ++o)
if(outs[o])
memset(outs[o], 0, sizeof(float)*sampleFrames);
return noErr;
}
Under a pevious version of the host all works fine, with
asOutBufs.mNumberBuffers=8. Under the latest version
asOutBufs.mNumberBuffers=2. Therefore the above code does nothing
to the other 6 channels resulting in noise on these channels.
Please let me know if anything is wrong with my methodology above.
Thanks,
Malcolm Haylock
_______________________________________________
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