title: Can my app be notified when another application starts/stops playing audio?
body: <p>My iOS game has music and sound effects. I'd like to let users listen to their own music in place of the game's background music. </p>
  
  <p>A simple solution is to add a new menu item that disables the game's background music. However, I'd like to avoid creating a new menu item unless I can be convinced that this approach is worse for the user. </p>
  
  <hr>
  
  <h1>My current approach:</h1>
  
  <ol>
  <li>Set the audio session category to <code>AVAudioSessionCategoryAmbient</code> to allow mixing of game audio with iPod (or other music app) playback.</li>
  <li>In <code>applicationDidBecomeActive</code>, check <code>[[AVAudioSession sharedInstance] isOtherAudioPlaying]</code> and turn off the game's music if another app is playing in the background.</li>
  </ol>
  
  <p>This seems to work under most circumstances. When the game launches, it interrupts the backgrounded music app's playback. If you want to play your own music, you then have to deliberately go back and press play in the third-party music app, or use iOS 7's swipe-up control panel. Otherwise, the game's own music will take over.</p>
  
  <p>This comes with a couple flaws:</p>
  
  <ol>
  <li><strong>It does not detect</strong> when the third-party music app's playback is started/stopped by the click-button remote control that's built into iPhone/iPod earbuds.</li>
  <li>Although it works with the iPod app, it doesn't work with the SoundCloud app. I have not tested any others.</li>
  </ol>
  
  <hr>
  
  <h1>The question:</h1>
  
  <p>Is there a way to receive notifications when third-party music apps (e.g. the iPod app) start/stop playback? Alternatively, is there a way to be notified when the value of <code>@property BOOL otherAudioPlaying</code> changes?</p>
  
  <p>Can this approach backfire? Is it foolish not to simply use a menu item?</p>