title: iOS Extracting Audio from .mov file
body: <p>I've been trying to extract audio from a .mov file for a while now and I just can't seem to get it working. Specifically, I need to extract the audio and save it as an .aif or .aiff file .</p>
  
  <p>I've tried using an AVMutableComposition, and loading the mov file as a AVAsset. Adding only the audio track to the AVMutableComposition before finally using an AVAssetExportSession (setting the output file type to AVFileTypeAIFF, which is the format I need it in), to write the file to an aif. </p>
  
  <p>I get an error saying that this output file type is invalid, I'm unsure why:</p>
  
  <p><em>*</em> Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Invalid output file type'</p>
  
  <pre><code>AVAssetExportSession *exporter;
  exporter = [[AVAssetExportSession alloc] initWithAsset:composition presetName:AVAssetExportPresetHighestQuality] ;
  
  exporter.audioMix = audioMix;
  exporter.outputURL=[NSURL fileURLWithPath:filePath];
  exporter.outputFileType=AVFileTypeAIFF;    //Error occurs on this line
  </code></pre>
  
  <p>I'm not sure if the above approach would work, but im open to the possibility that I'm just doing something wrong. However if anyone knows another way to accomplish what I'm trying to achieve, than any help would be greatly appreciated.</p>
  
  <p>I can post more detailed code if it is needed, but at the moment I'm trying a few other approaches so its a bit messy right now.</p>
  
  <p>Thanks for the help!</p>