Best way to load music/effects into game

Hi all,

I’ve got a game with the usual background music and effects. I’ve created a script that references/loads all audio from resources on startup and then plays them via audiomanager as needed. Everything works but - the loading times are getting impossibly long, and game ‘freezes’ during scene loading while music is being loaded, so i can’t make any loading bars/scene transitions easily.

I’d like to know what you’ve found to be a good way to load/play music/sound in your game and if i’m making any seriously bad mistakes.

If there’s no way to avoid long load times, how can i show a decent loading bar to show progress?

Thanks,
Primoz

Sounds like you have some dodgy audio import settings … see this article:

Just adding to this because I don’t think it’s actually mentioned in the article that was linked previously.

The freezes you’re getting are due to the audio files being loaded on the main resource thread. Check load in background and it won’t freeze the game while it loads. Just make sure you load it before you need it.

I wrote an in-depth article on audio optimisation that you might find helpful, here: Blog - John Leonard French

1 Like

Thanks guys, will be reading this and putting it to good use soon :slight_smile: