0
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];