使用AudioServices iPhone暂停正在播放的声音样本 [英] Halting a playing sound sample on iPhone using AudioServices
问题描述
我实现而用户拖动一个UISlider时播放的声音效果。
I am implementing a sound effect that plays while a user is dragging a UISlider.
下面是IBAction为:由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.
有没有办法做到这一点?似乎没有成为一个AudioServices ** **停止SystemSound()函数。
Is there a way to do that? There doesn't seem to be an AudioServices**Stop**SystemSound() function.
推荐答案
系统声音不能被停止。
查看<一个href=\"http://developer.apple.com/iphone/library/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/AudioandVideoTechnologies/AudioandVideoTechnologies.html#//apple%5Fref/doc/uid/TP40007072-CH19-SW35\"相对=nofollow> iPhone编程指南:部分Multimeda支持 以获取更多信息。
See the iPhone Programming Guide: section Multimeda Support for more information.
要达到预期的效果,我会建议使用的 AVAudioPlayer 或 audioQueues 。我解决的编程指南涵盖了你想了解这些技术的一切。
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.
这篇关于使用AudioServices iPhone暂停正在播放的声音样本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!