Simple HAL multichannel I/O question
Simple HAL multichannel I/O question
- Subject: Simple HAL multichannel I/O question
- From: Wayne <email@hidden>
- Date: Sun, 19 Sep 2010 13:36:54 -0700
I'm trying to output multichannel audio using pretty basic HAL calls. When I get the kAudioUnitProperty_StreamForamt, we can see the device supports 8 channels, however when our RenderProc is hit the AudioBufferList only contains two channels.
What are we missing?
Wayne
----
OSErr err = noErr;
AudioStreamBasicDescription theFormat;
UInt32 theSize = sizeof(AudioStreamBasicDescription);
memset(&theFormat, 0, sizeof(AudioStreamBasicDescription));
Component comp;
ComponentDescription desc;
desc.componentType = kAudioUnitType_Output;
desc.componentSubType = kAudioUnitSubType_HALOutput;
desc.componentManufacturer = kAudioUnitManufacturer_Apple;
desc.componentFlags = 0;
desc.componentFlagsMask = 0;
comp = FindNextComponent(NULL, &desc);
err = OpenAComponent(comp, &mOutputStream);
err = AudioUnitGetProperty(mOutputStream, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Output, 0, &theFormat, &theSize);
// can see at this point that theFormat.mChannelsPerFrame is == 8
AURenderCallbackStruct input;
input.inputProc = RenderCallbackProc;
input.inputProcRefCon = this;
err = AudioUnitSetProperty( mOutputStream,
kAudioUnitProperty_SetRenderCallback,
kAudioUnitScope_Global,
0,
&input,
sizeof(input));
err = AudioUnitInitialize(mOutputStream);
err = AudioOutputUnitStart(mOutputStream);
// audio starts
static OSStatus RenderCallbackProc(void * inRefCon,
AudioUnitRenderActionFlags *ioActionFlags,
const AudioTimeStamp * inTimeStamp,
UInt32 inBusNumber,
UInt32 inNumberFrames,
AudioBufferList * ioData)
{
// can see at this point that ioData->mNumberBuffers == 2
} _______________________________________________
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