사운드가 끝나면 다른 사운드를 재생할 수 있지만이 코드에서는 사운드가 혼합되어 있습니다 ... 어떻게 해결할 수 있습니까? audioplayerdidfinishplaying problem! iphone sdk
-(IBAction) ... {
for (...) {
if (compare(Output, N1)) {
songPath = [[NSBundle mainBundle] pathForResource:@"a" ofType:@"wav"];
}
if (compare(Output, N2)) {
songPath = [[NSBundle mainBundle] pathForResource:@"b" ofType:@"wav"];
}
audioPlayer=[[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath: songPath] error:NULL];
[audioPlayer setDelegate:self];
[audioPlayer play];
}
}
-(void) audioPlayerDidFinishPlaying: (AVAudioPlayer *) player successfully: (BOOL) flag {
NSLog(@"Song FINISHED!!!!!!");
[player release];
}
'for'루프에'[audioPlayer play]'를 넣었습니다. 분명히 루프에 여러 번의 오디오 플레이어가 함께있을 때보 다 1 회 이상의 반복이있는 경우입니다. –