0
Iam使用AVAudioplayer,我想暂停音乐几秒,当按下按钮时,并在6秒后,我想音乐开始播放而不按任何按钮。这甚至有可能吗?如果是这样,我该怎么做? 这里是我的代码示例:暂停AVAudioplayer几秒
NSString *soundPath2 =[[NSBundle mainBundle] pathForResource:@"background" ofType:@"wav"];
NSURL *soundURL2 = [NSURL fileURLWithPath:soundPath2];
NSError *error2 = nil;
self.backgroundMusic = [[AVAudioPlayer alloc] initWithContentsOfURL:soundURL2 error:&error2];
self.backgroundMusic.numberOfLoops = 9;
[self.backgroundMusic prepareToPlay];
[self.backgroundMusic play];