title: AVAudioPlayer not playing iPad2
body: <p>New to IOS dev, I'm testing AVAudioplayer to play sound on iPad2 (Xcode 4.2 project,  ARC/storyboard enabled). Sound plays ok in simulator and no error. No error on device either but no sound. </p>
  
  <p>Been browsing this fine resource temple, but nothing I've tried based on feedback here has produced anything but deafening iPad silence. Could someone help? My .h:</p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  #import &lt;AVFoundation/AVFoundation.h&gt;
  
  @interface ViewController : UIViewController
  &lt;AVAudioPlayerDelegate&gt;
  {
      AVAudioPlayer *audioPlayer;
      UISlider *volumeControl;
      UILabel *timerLabel;
      NSTimer *playbackTimer;
  }
  @property (nonatomic, retain) IBOutlet UISlider *volumeControl;
  @property (nonatomic, retain) IBOutlet UILabel *timerLabel;
  @property (nonatomic, retain) NSTimer *playbackTimer;
  @property (nonatomic, strong) AVAudioPlayer *audioPlayer;
  -(IBAction) playAudio;
  -(IBAction) stopAudio;
  -(IBAction) adjustVolume;
  @end
  </code></pre>
  
  <p>My .m:</p>
  
  <pre><code>#import "ViewController.h"
  
  @implementation ViewController
  @synthesize volumeControl, timerLabel, playbackTimer, audioPlayer;
  
  -(void)playAudio
  {
      playbackTimer = [NSTimer scheduledTimerWithTimeInterval:1.0
                                                       target:self
                                                     selector:@selector(updateTime)
                                                     userInfo:nil
                                                      repeats:YES];
      [audioPlayer play];
  }
  
  -(void)stopAudio
  {
      [playbackTimer invalidate];
      [audioPlayer stop];
  }
  -(void)adjustVolume
  {
      if (audioPlayer != nil)
      {
          audioPlayer.volume = volumeControl.value;
      }
  } 
  
  -(void)updateTime
  {
      float minutes = floor(audioPlayer.currentTime/60);
      float seconds = audioPlayer.currentTime - (minutes * 60);
  
      float duration_minutes = floor(audioPlayer.duration/60);
      float duration_seconds = 
      audioPlayer.duration - (duration_minutes * 60);
  
      NSString *timeInfoString = [[NSString alloc] 
                                  initWithFormat:@"%0.0f.%0.0f / %0.0f.%0.0f",
                                  minutes, seconds, 
                                  duration_minutes, duration_seconds];
  
      timerLabel.text = timeInfoString;
  }
  
  
  -(void)audioPlayerDidFinishPlaying:
  (AVAudioPlayer *)player successfully:(BOOL)flag
  {
  }
  -(void)audioPlayerDecodeErrorDidOccur:
  (AVAudioPlayer *)player error:(NSError *)error
  {
  }
  -(void)audioPlayerBeginInterruption:(AVAudioPlayer *)player
  {
  }
  -(void)audioPlayerEndInterruption:(AVAudioPlayer *)player
  {
  }
  </code></pre>
  
  <p>my viewDidLoad:</p>
  
  <pre><code> - (void)viewDidLoad {
          [super viewDidLoad];
  
          NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle]
                                               pathForResource:@"song"
                                               ofType:@"mp3"]];
  
          NSError *error;
          audioPlayer = [[AVAudioPlayer alloc]
                         initWithContentsOfURL:url
                         error:&amp;error];
          if (error)
          {
              NSLog(@"Error in audioPlayer: %@", 
                    [error localizedDescription]);
          } else {
              audioPlayer.delegate = self;
              [audioPlayer prepareToPlay];
          }
  
      [super viewDidLoad];
  }
  </code></pre>