Reputation: 3349
Load sound after 3 seconds delay. When loading this sound, animations that happening in the update function stuck for a moment(mili seconds)
- (void) onEnter
{
[super onEnter];
[self schedule:@selector(update:)];
[self performSelector:@selector(playSong) withObject:nil afterDelay:3];
}
-(void)playSong{
soundEffectID=[[SimpleAudioEngine sharedEngine] playEffect:@"song.mp3"];
}
Sound file is only 400kb.
Upvotes: 0
Views: 86
Reputation: 695
Please use preloadEffect
Before playing it, It will avoid the jerk in the animation and frame rate.
Example : [[SimpleAudioEngine sharedEngine] preloadEffect:@"bell.wav"];
Upvotes: 1