title: AudioServicesPlaySystemSound sound not audible when called from IBAction method
body: <p>I'm having a problem with AudioServicesPlaySystemSound in my iOS app.</p>
  
  <p>I have a method defined to play a system sound.  When I call the method from viewDidLoad, I can hear the sound play, but when I call it from a button handler, I do not hear the sound play.</p>
  
  <p>Here's the code from my view controller:</p>
  
  <pre><code>SystemSoundID startSound = 0;
  
  -(void)playStartSound
  {        
      AudioServicesPlaySystemSound(startSound);
  }
  
  -(void)viewDidLoad 
  {           
      NSURL *urlStart = [[NSBundle mainBundle] URLForResource:@"Beep" withExtension:@"wav"];
      AudioServicesCreateSystemSoundID((CFURLRef)urlStart, &amp;startSound);
  
      [self playStartSound];    
  
      [super viewDidLoad];
  }
  
  - (IBAction)start:(id)sender
  {
      [self playStartSound];
  }
  </code></pre>
  
  <p>The IBAction method is associated with a button.  When I select the button, the playStartSound method gets called, but the sound is not audible.</p>
  
  <p>The system sound is not disposed of with AudioServicesDisposeSystemSoundID until the dealloc method is called.</p>
  
  <p>I've tried calling AudioServicesCreateSystemSoundID from within playStartSound, but it didn't make any difference.</p>
  
  <p>The app also uses AV Foundation, Media Player, Core Media, Core Video, and Core Location.  I'm wondering if one of these might be interfering with AudioToolbox?</p>
  
  <p><strong>UPDATE</strong>:  I just put together a simple app that just contains the above code and a button and the sound plays just fine when I select the button.</p>
  
  <p>So then I removed all the video capture code from my controller and now the audio plays fine.</p>