core audio , multi-channel output

Apple APIs and Mac audio software development

core audio , multi-channel output

Postby stephanschulz » Mon, 06 May 2013 6:27 am

hi

i have been looking every for examples on how to use multi channel output happen with core audio. but no luck so far.

i am used to writing my own software in c++ and objective-c, and i am able to put something together to get regular stereo outputs working. but nothing on how to talk to an audio device that has more then 2 channels

here is part of the code that works for stereo outputs:

UInt32 busCount = 3; //numberOfOutputBusses;
AudioStreamBasicDescription outputASBD2 = {
.mSampleRate = 44100,
.mFormatID = kAudioFormatLinearPCM,
.mFormatFlags = kAudioFormatFlagsAudioUnitCanonical,
.mChannelsPerFrame = busCount,
.mFramesPerPacket = 1,
.mBitsPerChannel = sizeof(Float32) * 8,
.mBytesPerPacket = sizeof(Float32) * busCount,
.mBytesPerFrame = sizeof(Float32) * busCount
};

AudioUnitSetProperty(*_unit,
kAudioUnitProperty_StreamFormat,
kAudioUnitScope_Output,
1,
&outputASBD2,
sizeof(AudioStreamBasicDescription);

any advice would be great.

thx.
stephanschulz
 
Posts: 1
Joined: Mon, 06 May 2013 6:15 am

Return to Developers



Who is online

Users browsing this forum: No registered users and 1 guest

cron