AudioServicesPlaySystemSound know when sound stopped

末鹿安然 提交于 2020-01-05 05:38:14

问题


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!


回答1:


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.



来源:https://stackoverflow.com/questions/14121612/audioservicesplaysystemsound-know-when-sound-stopped

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!