I found a problem. I do not need two audio interfaces. In fact, it seems that they are somehow redefined.
If I remove the new audioInputParam and make two ramp sets, everything works fine. This is actually a curious miss. SetRamp seems to be overridden, and "addObject" is the one that overrides. I ended up with this code for the part:
AVMutableAudioMixInputParameters *audioInputParams = [AVMutableAudioMixInputParameters audioMixInputParametersWithTrack:track]; CMTime fadeDuration = CMTimeMakeWithSeconds(5, 600); CMTime fadeOutStartTime = CMTimeMakeWithSeconds(CMTimeGetSeconds(myAVPlayerItem.duration)-5, 600); CMTime fadeInStartTime = CMTimeMakeWithSeconds(0, 600); [audioInputParams setVolumeRampFromStartVolume:1.0 toEndVolume:0 timeRange:CMTimeRangeMake(fadeOutStartTime, fadeDuration)]; [audioInputParams setVolumeRampFromStartVolume:0.0 toEndVolume:1.0 timeRange:CMTimeRangeMake(fadeInStartTime, fadeDuration)]; [allAudioParams addObject:audioInputParams];
Thanks @Mundi for trying to help me.
source share