title: MP3 playing using AVAudioPlayer not working on device
body: <p>I am testing my app on my 3GS iPhone with iOS 4.2</p>
  
  <p>I am using the following code which plays a sound in my IBAction. It works perfectly in the simulator (both iPad and iPhone) - I hear the sound. </p>
  
  <pre><code>NSString *pathToMusicFile1 = [[NSBundle mainBundle] pathForResource:@"alarm" ofType:@"mp3"];
  NSError *error;
  alarmSound = [[AVAudioPlayer alloc]initWithContentsOfURL:[NSURL fileURLWithPath:pathToMusicFile1] error:&amp;error]; 
  NSLog(@"Song1 Loaded");
  if (alarmSound == nil) {
      NSLog(@"Error playing sound");
  } else {
      alarmSound.numberOfLoops = 20;
      alarmSound.volume = 1.0;
      [alarmSound play];
  }
  </code></pre>
  
  <p>I have everything declared properly (headers and frameworks etc) as I can hear the sound in the simulator. </p>
  
  <p>I have also checked that my phone is NOT in silent mode!! I hear other sounds from the generic iphone GUI. (example from a datepicker).</p>
  
  <p>I have also cleaned all targets and deleted the app to reinstall. </p>
  
  <p>Any ideas what's wrong?! </p>