title: Delay in playing sounds using AVAudioPlayer
body: <pre><code>-(IBAction)playSound{ AVAudioPlayer *myExampleSound;
  
  NSString *myExamplePath = [[NSBundle mainBundle] pathForResource:@"myaudiofile" ofType:@"caf"];
  
  myExampleSound =[[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:myExamplePath] error:NULL];
  
  myExampleSound.delegate = self;
  
  [myExampleSound play];
  
  }
  </code></pre>
  
  <p>I want to play a beep sound when a button is clicked. I had used the above code. But it is taking some delay in playing the sound.</p>
  
  <p>Anyone please help.</p>