What is the best strategy for SimpleAudioEngine effects preload ? Preload all sound effects at game startup ? Or in each screen’s creation preload only the effects used in this screen ?
Are loaded effects released at some point ?
What is the best strategy for SimpleAudioEngine effects preload ? Preload all sound effects
Share
You preload if playing the sound effect for the first time causes a noticeable lag. For action games you want to preload all gameplay effects. For turn-based or otherwise “slower paced” games it may be ok not to preload any sound effects.
When and where you preload depends on your needs. Typically at the start of a gameplay scene (ie during init or onEnter).
A preloaded effect is not released unless you call unloadEffect on it. Internally the audio engine caches sound effects, so this is not exclusive to preloading. Simply playing a sound effect will also load it and keep it in memory as well.