开发者

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?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜