0
AVAudioPlayer를 사용하는 동안 .... 버튼을 클릭하면 즉석에서 재생되지 않는 사운드 ... 그 클래스에서 나는 이미지를 계속 변경하는 하나의 NSTimer를 가지고있어서 사운드를 울려야합니다.AVAudioPlayer에 문제가 있습니까? 지연 생성
하지만이 AudioServicesCreateSystemSoundID((CFURLRef)[NSURL fileURLWithPath: soundPath], &soundID);
을 사용하면 ... 장치에서 사운드를들을 수 없습니다. 파일이 mp3 형식이기 때문에 발생합니다.
AVAudioPlayer 코드 :
내가 그렇게 원활하게 시스템 사운드가하는 것처럼 AVAudioPlayer을 사용할 수없는 나는 왜NSURL *url = [NSURL fileURLWithPath:[NSString stringWithFormat:@"%@/slotmachine.mp3", [[NSBundle mainBundle] resourcePath]]];
NSError *error;
audioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:url error:&error];
audioPlayer.numberOfLoops = -1;
[audioPlayer play];
그래서 사람이 .. 통합 할 수있는 적절한 방법은 무엇입니까 말해 줄 수?