title: Need an iOS 4 Audio API that can be used like the alarm app
body: <p>I am working on an alarm application, I need to find the best method of playing a sound that will:</p>
  
  <ul>
  <li>Play a looped sound, or pre-looped sound when the app is in the background</li>
  <li>Can be paused/stopped. When the user has clicked to dismiss the alarm in an alert I need to stop the sound</li>
  <li>Override the mute switch (preferably)</li>
  <li>Will respect the volume control (preferably)</li>
  <li>Will pause the iPod (preferably)</li>
  </ul>
  
  <p>My main requirements are my first two points, have tried using SystemSounds however I can't seem to stop these, once you tell it to play it plays until the sound is finished. This however works in the background but cannot be looped. And is silenced by the mute switch.</p>
  
  <p>Am using an AudioSession currently to ignore the mute switch. Am also currently using AVAudioPlayer which allows me to control the play/pausing of the sound. But won't work in the background! Is there any way of using AVAudioPlayer and AudioSession to play a background sound or do I need to use something else? OpenAL?</p>
  
  <p>Any help will be GREATLY appreciated...</p>
  
  <p>Thanks,</p>
  
  <p>Paul</p>