AudioServicesPlaySystemSound(soundID) - How to STOP a sound?

Discussion in 'iOS Programming' started by ethana, Dec 17, 2008.

  1. ethana
    Expand Collapse
    macrumors 6502a

    Joined:
    Jul 17, 2008
    Location:
    Seattle, WA
    #1
    AudioServicesCreateSystemSoundID((CFURLRef)filePath, &soundID);
    AudioServicesPlaySystemSound(soundID);

    I am playing a sound effect that is about 5 seconds long with the calls above. How do I stop the sound right in the middle of it playing?

    Ethan
     
  2. bigsprocket
    Expand Collapse
    macrumors newbie

    Joined:
    Dec 18, 2008
    #2
  3. Niiro13
    Expand Collapse
    macrumors 68000

    Joined:
    Feb 12, 2008
    Location:
    Illinois
    #3
    There's no method to pause it (which is why most people use AudioQueue or OpenAL) or stop it (in a sense where you're simply stopping the sound ready to be played again), but you can use the AudioServicesDisposeSystemSoundID which will theoretically stop the sound.
     
  4. neil.b
    Expand Collapse
    macrumors member

    neil.b

    Joined:
    Nov 20, 2008

Share This Page