stephanschulz
stephanschulz

Reputation: 119

how to use AUMatrixMixer

i know the AUMatrixMixer is what i need. "A unit that mixes an arbitrary number of inputs to an arbitrary number of outputs."

i found some info here: http://coreaudio-audiounits.blogspot.ca/2013/04/aumatrixmixer-simplified.html http://developer.apple.com/library/ios/#documentation/AudioUnit/Reference/AudioUnitPropertiesReference/Reference/reference.html

but the documentation on how to implement it is non existing. how would i set it up, how would i route a specific input to the mixer to a specific output; i.e. how to set up the matrix.

Upvotes: 2

Views: 1551

Answers (1)

sbooth
sbooth

Reputation: 16966

There is a posting on the coreaudio-api list that might help (http://lists.apple.com/archives/coreaudio-api/2008/Apr/msg00169.html):

The matrix mixer allows you to connect any number of input and ouput elements with any number of channels each. You need to make sure you set the stream formats of the inputs and outputs so that the channel numbers are correct. Each input and output channel is numbered sequentially across all elements. So if you were to connect one stereo inputs, one mono input, and another stereo input, the channels in the mixer would be numbered as follows: stereo: 0 1 mono: 2 stereo: 3 4 Outputs are numbered in a similar fashion.

The channel numbers are what you use to set gains in the matrix. The matrix has 4 gain controls that can affect any particular route from input to output:

master gain (global scope) - affects the gain of all outputs

input channel gain (input scope) - affects the gain of a particular input channel

output channel gain (output scope) - affects the gain of a particular output channel

crosspoint gain (global scope) - controls the gain of a single input channel going to a single output channel. You make connections from inputs to outputs by setting crosspoint gains to nonzero values.

When setting crosspoint gain parameters, the element number is used differently from other audio units. Crosspoints are set using an element number that is constructed from both the input and the output channel numbers as follows:

element_number = (input_channel << 16) | output_channel

Master gain has element number 0xFFFFFFFF.

Upvotes: 5

Related Questions