title: Sound not playing when iPhone is in silent mode
body: <p>I am making an app that needs to play sounds even if the iPhone is in silent mode, but with the code I have now (look at bottom of this post) it wont't play sounds if the iPhone is in silent mode.</p>
  
  <p>I am using the following code:</p>
  
  <p>Viewcontroller.h:</p>
  
  <pre><code>@interface SoundViewController : UIViewController &lt;UICollectionViewDataSource, UIApplicationDelegate, AVAudioPlayerDelegate, ADBannerViewDelegate, UIActionSheetDelegate&gt; {
      SystemSoundID SoundID;
      NSString *listPath;
  
  }
  </code></pre>
  
  <p>ViewController.m:</p>
  
  <pre><code>CFBundleRef mainBundle = CFBundleGetMainBundle();
  CFURLRef soundFileURLRef;
  soundFileURLRef = CFBundleCopyResourceURL(mainBundle, (__bridge CFStringRef) [mainArray objectAtIndex:indexPath.row], CFSTR("wav"), NULL);
  UInt32 soundID;
  AudioServicesCreateSystemSoundID(soundFileURLRef, &amp;soundID);
  AudioServicesPlaySystemSound(soundID);
  </code></pre>