Cocos2d 应用程序在加载声音时冻结



延迟 3 秒后加载声音。加载此声音时,更新函数中发生的动画会卡住片刻(毫秒)

- (void) onEnter
{
[super onEnter];
[self schedule:@selector(update:)];
[self performSelector:@selector(playSong) withObject:nil afterDelay:3];
}
-(void)playSong{
 soundEffectID=[[SimpleAudioEngine sharedEngine] playEffect:@"song.mp3"];
}

声音文件只有400kb。

请在播放之前使用 preloadEffect,它将避免动画和帧速率的抖动。

例 : [[SimpleAudioEngine sharedEngine] preloadEffect:@"bell.wav"];

最新更新