When debugging this, I see a problem, but I'm not sure why this is happening.
When you add parameters to an array, for example:
[inputParams addObject:audioParams]
The track ID is set to 0, so it is never attached to any track:
On the console:
<AVMutableAudioMixInputParameters: 0x16eab300, track ID = 0, volume mix: volume 0.010 at time 0.000>
I solved this by not using the audioParamsForTrack method, but doing the work immediately before the array, for example:
NSMutableArray *inputParams = [NSMutableArray arrayWithCapacity:4]; AVMutableAudioMixInputParameters *audioInputParams = [AVMutableAudioMixInputParameters audioMixInputParametersWithTrack:AudioTrack]; [audioInputParams setVolume:.01f atTime:kCMTimeZero]; AVAudioMixInputParameters *audioParams = audioInputParams; [inputParams addObject:audioParams]; audioMix.inputParameters = inputParams;
Micah source share