【发布时间】:2014-01-02 08:56:27
【问题描述】:
我有一个动画,当按下按钮时它会播放。
我需要同时播放声音。
如果快速连续按下按钮两次,声音会在第二次按下时从头开始播放,但动画只会循环一次,因为声音比动画长度短。
有人对此有解决方案吗?
也许有一种方法可以让声音按钮只有在动画播放完毕后才能再次工作?
//Panel 1 Sound Button Action.
- (IBAction)playSound:(id)sender {
AudioServicesPlaySystemSound(SoundID);
//Panel 1 Sound
NSURL *buttonURL = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"panel01" ofType:@"wav"]];
AudioServicesCreateSystemSoundID((__bridge CFURLRef)buttonURL, &SoundID);
【问题讨论】: