manuelBetancurt
manuelBetancurt

Reputation: 16138

AudioServicesPlaySystemSound know when sound stopped

Im using

AudioServicesPlaySystemSound(soundID);

to play a sound, but I need to know when the sound has stopped playing, so what is the delegate for this?

Thanks!

Upvotes: 2

Views: 2377

Answers (1)

Krishnabhadra
Krishnabhadra

Reputation: 34265

Have you read the documentation?

AudioServicesPlaySystemSound

Plays a system sound object.

void AudioServicesPlaySystemSound (
   SystemSoundID inSystemSoundID
);

Discussion This function plays a short sound (30 seconds or less in duration). Because sound might play for several seconds, this function is executed asynchronously. To know when a sound has finished playing, call the AudioServicesAddSystemSoundCompletion function to register a callback function.

This stackoverflow question might help you to learn how to use this callback.

Upvotes: 5

Related Questions