Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ethana

macrumors 6502a
Original poster
Jul 17, 2008
836
0
Seattle, WA
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
 

Niiro13

macrumors 68000
Feb 12, 2008
1,719
0
Illinois
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.