AudioServicesPlaySystemSound知道什么时候停止的声音 [英] AudioServicesPlaySystemSound know when sound stopped
问题描述
即时通讯使用
AudioServicesPlaySystemSound(soundID);
播放声音,但我需要的时候声音停止播放才知道,究竟什么是委托呢?
谢谢!
你读过的<一个href=\"http://developer.apple.com/library/ios/#documentation/AudioToolbox/Reference/SystemSoundServicesReference/Reference/reference.html\">documentation?
AudioServicesPlaySystemSound
播放系统声音对象。
块引用>无效AudioServicesPlaySystemSound(
SystemSoundID inSystemSoundID
);
讨论:此功能播放(持续时间30秒或更少)一短声。因为声音可以发挥几秒钟,这
函数是异步执行的。 要知道在声音
演奏完毕,叫AudioServicesAddSystemSoundCompletion
函数注册一个回调函数
块引用><一个href=\"http://stackoverflow.com/questions/6410143/audioservicesaddsystemsoundcompletion-callback-method-is-not-called-after-a-few\">This计算器的问题可以帮助你学习如何使用此回调。
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!
解决方案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.
这篇关于AudioServicesPlaySystemSound知道什么时候停止的声音的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!