title: Audio glitch when playing two AVPlayer audio files simultaneously
body: <p>I have an iOS app that plays a background soundtrack with one AVPlayer and plays other sound clips "on top" with a second AVPlayer. (The sound clips are streamed from the Internet, hence the requirement for AVPlayer.) The problem is that when the second AVPlayer starts playing, it causes the background AVPlayer to stop for a fraction of a second, similar to what's described in this comment:</p>
  
  <p><a href="https://stackoverflow.com/questions/6193844/play-multiple-audio-files-with-avplayer#comment7213305_6193844">Play multiple Audio Files with AVPlayer</a></p>
  
  <p><br/></p>
  
  <p>I am preparing the audio clips with this method:</p>
  
  <pre><code>- (void)prepareAudio:(NSURL *)assetURL {
  
  asset = [AVURLAsset URLAssetWithURL:assetURL options:nil];
  playerItem = [AVPlayerItem playerItemWithAsset:asset];
  [player replaceCurrentItemWithPlayerItem:playerItem];
  
  
  [playerItem addObserver:self forKeyPath:@"playbackBufferEmpty" options:NSKeyValueObservingOptionNew context:nil];
  [playerItem addObserver:self forKeyPath:@"playbackLikelyToKeepUp" options:NSKeyValueObservingOptionNew context:nil];
  
  
  [[NSNotificationCenter defaultCenter] addObserver:self
                                           selector:@selector(playerItemDidReachEnd:)
                                               name:AVPlayerItemDidPlayToEndTimeNotification
                                             object:[player currentItem]];
  
  [[NSNotificationCenter defaultCenter] addObserver:self
                                           selector:@selector(playerItemFailedToReachEnd:)
                                               name:AVPlayerItemFailedToPlayToEndTimeNotification
                                             object:[player currentItem]];
   }
  </code></pre>
  
  <p>...and then invoking <code>[player play];</code> when I want to hear each sound.</p>
  
  <p><br/></p>
  
  <p><strong>Is there something I need to do when I set up the audio session or each instance of the AVPlayer, so that the sounds blend without the glitch?</strong></p>