AVAudioPlayer freezes when play first song
I'm using AVAudioPlayer class to play sound in my app. When i play sound first time, screen freezes for a 2-3 seconds, then it becomes active and without freezes and delays. Even when I change sound. Here is some code:
avPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:nil];
[avPlayer prepareToPlay];
[avPlayer play];
Sound f开发者_如何学Pythoniles are in Documents folder and file paths are correct; How to minimize delay or remove freezes?
精彩评论