title: get error code -11843 while exporting mp3 file in ipod library since iOS 5.1
body: <p>I use the AVAssetExportSession to export mp3/m4a files in ipod library. This method works well on iOS 5.0 and earlier. However after upgrade iOS to 5.1, this method doesn't work for mp3 anymore, but still works for m4a.</p>
  
  <p>Here is the source code.</p>
  
  <pre><code>AVURLAsset *songAsset = [AVURLAsset URLAssetWithURL: [mediaItem assetUrl] options:nil];
  
  NSLog (@"compatible presets for songAsset: %@",[AVAssetExportSession exportPresetsCompatibleWithAsset:songAsset]);
  
  AVAssetExportSession *exporter = [[AVAssetExportSession alloc]
                                    initWithAsset: songAsset
                                    presetName: AVAssetExportPresetPassthrough];
  
  NSLog (@"created exporter. supportedFileTypes: %@", exporter.supportedFileTypes);
  NSLog(@"output file type=%@",[mediaItem fileType]);
  NSLog(@"export file path=%@",exportPath);
  exporter.outputFileType =[mediaItem fileType];
  
  NSError *error1;
  error1=0;
  
  if([[NSFileManager defaultManager] fileExistsAtPath:exportPath]) 
  {
  
      [[NSFileManager defaultManager] removeItemAtPath:exportPath error:&amp;error1];
      if(error1)
          NSLog(@"%@",error1);
  
  }
  
  NSURL* exportURL = [NSURL fileURLWithPath:exportPath];
  
  exporter.outputURL = exportURL; 
  
  // do the export
  [exporter exportAsynchronouslyWithCompletionHandler:^{
  
      int exportStatus = exporter.status;
  
      switch (exportStatus) {
  
          case AVAssetExportSessionStatusFailed: {
  
              NSError *exportError = exporter.error;
  
              NSLog (@"AVAssetExportSessionStatusFailed: %@", exportError);
              [delegate convertCancelled:self];
              [exporter release];
  
              break;
          }
  
          case AVAssetExportSessionStatusCompleted: {
  
              NSLog (@"AVAssetExportSessionStatusCompleted");
              [delegate convertDone:self];
              [exporter release];
              break;
          }
  
          case AVAssetExportSessionStatusUnknown: { NSLog (@"AVAssetExportSessionStatusUnknown");
              break;
          }
          case AVAssetExportSessionStatusExporting: { NSLog (@"AVAssetExportSessionStatusExporting"); 
              break;
          }
  
          case AVAssetExportSessionStatusCancelled: { NSLog (@"AVAssetExportSessionStatusCancelled");
  
              NSLog(@"Cancellated");
              [delegate convertCancelled:self];
  
              break;
          }
  
          case AVAssetExportSessionStatusWaiting: {
              NSLog (@"AVAssetExportSessionStatusWaiting");
              break;
          }
  
          default: 
          { NSLog (@"didn't get export status"); 
              break;
          }
      }
  
  }];
  </code></pre>
  
  <p>Here is the message I get in console:</p>
  
  <pre><code>output file type=com.apple.quicktime-movie
  export file path=/private/var/mobile/Applications/xxxxxx/tmp/I See the Light - Instrumental cover.mp3
  AVAssetExportSessionStatusFailed: Error Domain=AVFoundationErrorDomain Code=-11843 "Cannot write output file" 
  UserInfo=0x93876e0 {NSLocalizedRecoverySuggestion=Change the output extension and try again., NSLocalizedDescription=Cannot write output file}
  </code></pre>
  
  <p>Anyone knows why?
  The error message tells me to change the file extension, but it is not reasonable to use other file extension for mp3 file.</p>