请记住,我是新手,因此不是很有经验:我有几个由按钮触发的音频文件播放,每次按下按钮时,所有其他声音都会停止。现在我想创建一个按钮来停止当前正在播放的任何内容。另外,每次我按下一个按钮时,音乐都不是从头开始,而是从中断的时间点开始。提前谢谢你,这是一个片段:
- (IBAction)playSound1 {
if ((self.sound2Player.playing) || (self.sound3Player.playing)|| (self.sound4Player.playing)||(self.sound5Player.playing)||(self.sound6Player.playing)||(self.sound7Player.playing))
[self.sound2Player stop];
[self.sound3Player stop];
[self.sound4Player stop];
[self.sound5Player stop];
[self.sound6Player stop];
[self.sound7Player stop];
[self.sound2Player stop];
[self.sound1Player play];