1
나는이 코드를 사용하여 사운드를 재생하지만 처음 재생할 때로드하는 데 5 초가 걸립니다.코코아 터치 - 로딩 AVAudioPlayer
어떻게하면 속도를 높일 수 있습니까?
-(IBAction)playSound{ //play the cricket noise
NSString *soundPath = [[NSBundle mainBundle] pathForResource:@"Cricket_Sound" ofType:@"mp3"];
audioPlayer =[[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:soundPath] error:NULL];
audioPlayer.delegate = self;
[audioPlayer prepareToPlay];
audioPlayer.numberOfLoops = 0;
[audioPlayer play];
}