AudioServicesPlaySystemSound知道什么时候停止的声音(AudioServi

2019-10-17 13:43发布

我正在使用

AudioServicesPlaySystemSound(soundID);

播放声音,但我需要知道什么时候声音停止播放,所以什么是委托呢?

谢谢!

Answer 1:

你读过的文档 ?

AudioServicesPlaySystemSound

播放系统声音对象。

void AudioServicesPlaySystemSound (
   SystemSoundID inSystemSoundID
);

讨论此函数起到了短的声音(在持续时间30秒或更少)。 因为声音可以发挥几秒钟,该功能是异步执行的。 要知道在声音播放完毕,调用AudioServicesAddSystemSoundCompletion函数注册一个回调函数

这个计算器的问题可以帮助你学习如何使用此回调。



文章来源: AudioServicesPlaySystemSound know when sound stopped