title: AVMutableCompositionTrack setVolume not working
body: <p>I'm having problem to set the audio volume when mixing a recorded video and an audio from resource.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>AVMutableComposition *composition = [[AVMutableComposition alloc] init];
  NSString *resourcePath = [[NSBundle mainBundle] pathForResource:@"give-it-away" ofType:@"mp3"];
  AVURLAsset *audioAsset = [[AVURLAsset alloc] initWithURL:[NSURL fileURLWithPath:resourcePath] options:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:YES],AVURLAssetPreferPreciseDurationAndTimingKey, nil]];
  AVMutableCompositionTrack *videoTrack = [composition addMutableTrackWithMediaType:AVMediaTypeVideo preferredTrackID:kCMPersistentTrackID_Invalid];
  AVMutableCompositionTrack *audioTrack = [composition addMutableTrackWithMediaType:AVMediaTypeAudio preferredTrackID:kCMPersistentTrackID_Invalid];
  [videoTrack insertTimeRange:CMTimeRangeMake(kCMTimeZero, videoAsset.duration) ofTrack:[videoAsset.tracks objectAtIndex:0] atTime:kCMTimeZero error:nil];
  [audioTrack insertTimeRange:CMTimeRangeMake(kCMTimeZero, audioTime) ofTrack:[audioAsset.tracks objectAtIndex:0] atTime:kCMTimeZero error:&amp;videoError];
  
  AVMutableAudioMixInputParameters *audioInputParams = [AVMutableAudioMixInputParameters audioMixInputParametersWithTrack:audioTrack] ;
  [audioInputParams setVolume:0.3 atTime:kCMTimeZero];
  [audioInputParams setTrackID:audioTrack.trackID];
  AVMutableAudioMix *audioMix = [AVMutableAudioMix audioMix];
  audioMix.inputParameters = [NSArray arrayWithObject:audioInputParams];
  
  AVAssetExportSession *exportSession = [[AVAssetExportSession alloc] initWithAsset:composition presetName:AVAssetExportPresetPassthrough];
  
  exportSession.outputURL = [NSURL fileURLWithPath:finalVideoWithAudioPath];
  exportSession.outputFileType = AVFileTypeQuickTimeMovie;            
  exportSession.audioMix = audioMix;            
  [exportSession exportAsynchronouslyWithCompletionHandler:^{
        switch (exportSession.status)
        {
            case AVAssetExportSessionStatusFailed:
            {
                 [self performSelectorOnMainThread:@selector(doPostExportFailed) withObject:nil waitUntilDone:NO];
                 break;
            }
            case AVAssetExportSessionStatusCompleted:
            {
                 [self performSelectorOnMainThread:@selector(doPostExportSuccess) withObject:nil waitUntilDone:YES];
                 break;
            }
        };
  }];
  </code></pre>
  
  <p>The export completes successfully, but the audio volume does not change.
  What am I doing wrong?</p>
  
  <p>Thanks</p>