I've been trying for a few days to use the kAudioUnitSubType_MatrixMixer
on iOS.
For testing purposes I tried to port the MatrixMixerTest sample code from MacOSX. But I don't have any sound (there is no error reported).
here is what I do :
- Create
AUGraph
- Add
RemoteIO
Node to graph - Add
MatrixMixer
Node to graph - Connect
MatrixMixer
toRemoteIO
. - Open
AUGraph
- Getting the Mixer
AudioUnit
fromMatrixMixer
Node - Setting 2 Input Bus to Mixer
AudioUnit
- Setting 1 Output Bus to Mixer
AudioUnit
- Setting Rendering Callback to both Inputs
- Setting Correct
StreamFormat
to each input bus - Setting Correct
StreamFormat
to output bus AuGraph
Initialize- Setting All volumes of the matrixmixer to 1.0
And when I start the graph no sound, and no error. And when I show the matrix Mixer with PrintMatrixMixerVolumes
(from Core Audio Utility by Apple) everything looks normal.
One of my question is : Is the AUMatrixMixer really works on iOS ? And the other is : Is there something specific to do with this Audio Unit ?
Thank You
EDIT : When I print the matrix it shows :
Input Channels = 4, Output Channels = 2
Input Elements:
0:[2, T] 1:[2, T]
Output Elements:
0:[2, T]
Global Volume: 1.000
1.000 (1.000) (1.000)
1.000 (1.000) (1.000)
1.000 (1.000) (1.000)
1.000 (1.000) (1.000)
1.000 1.000