我刚接触Xcode中的声音,我希望重复播放一个声音,无论它是否已经在播放。例如:我有三个正在拍摄的激光,我希望激光声音同时播放三次,而不是等待每一个都播放完。如何使用AVAudioPlayer实现这一点?
发布于 2012-09-25 17:59:19
执行以下操作:
AVAudioPlayer *laserSound1 = .........
laserSound1.numberOfLoops = 2; //plays three times simultaneously
[laserSound1 play];
AVAudioPlayer *laserSound2 = .........
laserSound2.numberOfLoops = 2;//plays three times simultaneously
[laserSound2 play];
AVAudioPlayer *laserSound3 = .........
laserSound3.numberOfLoops = 2;//plays three times simultaneously
[laserSound3 play];https://stackoverflow.com/questions/12580177
复制相似问题