Re: kAudioUnitSubType_MultiChannelMixer: Mixing 8 channels down to 2 channels [Mac]
Re: kAudioUnitSubType_MultiChannelMixer: Mixing 8 channels down to 2 channels [Mac]
- Subject: Re: kAudioUnitSubType_MultiChannelMixer: Mixing 8 channels down to 2 channels [Mac]
- From: Aran Mulholland <email@hidden>
- Date: Wed, 08 Aug 2012 11:52:14 +1000
I think that you have to let the mixer know that it is accepting 8
channels of audio which is different than the stream format.
//set the number of inputs on the mixer
UInt32 numbuses = 8;
XThrowIfError(AudioUnitSetProperty(mixerUnit_,
kAudioUnitProperty_ElementCount, kAudioUnitScope_Input, 0, &numbuses,
sizeof(numbuses)), "Could not set number of busses on mixer unit");
//get the current number of inputs
UInt32 size = sizeof(UInt32);
XThrowIfError(AudioUnitGetProperty(mixerUnit_,
kAudioUnitProperty_ElementCount, kAudioUnitScope_Input, 0, &numbuses,
&size),"Could not get number of busses on mixer unit");
Is that what you need?
On Tue, Aug 7, 2012 at 11:10 PM, Leon Szpilewski <email@hidden> wrote:
> Hello List,
>
> I'm a little stuck with the kAudioUnitSubType_MultiChannelMixer AudioUnit on
> the Mac:
>
> I'm creating audio streams with 8 channels of data and want them to output
> through the AUHAL. When the output device I use has 8+ channels everything
> works as expected: The 8 data channels are mapped 1:1 to the device
> channels. So this obviously works.
>
> Now when I want to output these 8 channels on a device with only 2
> out-channels I understand I have to mix the audio down. So I added a
> kAudioUnitSubType_MultiChannelMixer to the graph and set the input format to
> 8 channels, output format to 2 channels. I assume this should mix down the
> incoming 8 channels to a 2 channel stream.
>
> So my graph looks like this:
> [data input callback] ---8ch---> [mixer] ---2ch---> [AUHAL]
> Note: All the units use just one bus.
>
> Now what happens is that you can only hear the first 2 channels of the
> incoming data. The remaining 6 channels seem to get discarded by the mixer.
> (I tried running 8->8 channels through the mixer and everything works then -
> no channels get discarded. Also mixing stereo -> mono works too).
>
> Am I making false assumption? Do I have to set any parameters for this kind
> of mixing to work? Or is the kAudioUnitSubType_MultiChannelMixer not the
> right unit at all? (I could do the mix down by hand in the data callback but
> that's something I'd rather not do.)
>
>
> Thanks for your input
> Leon
>
> _______________________________________________
> 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
>
_______________________________________________
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