views:

452

answers:

1

I am implementing a sound effect that plays while a user is dragging a UISlider.

Here is the IBAction: called by the UISlider's Value Changed event

-(IBAction)playTone4; {
    AudioServicesPlaySystemSound(soundID4); 
}

I would like the sound to halt when the user is not dragging the slider but has not released it.

Is there a way to do that? There doesn't seem to be an AudioServices**Stop**SystemSound() function.

+3  A: 

System sounds cannot be stopped.

See the iPhone Programming Guide: section Multimeda Support for more information.

To accomplish the desired effect, I would recommend using AVAudioPlayer or audioQueues. The Programming Guide I addressed covers everything you want to know about these techniques.

Kriem