[Request] Preload audio and fonts

GDevelop does not preload audio and fonts.
The result is that, when we use a font for the very first time in our game, it may not be applied on the text in the scene but only after we reload the scene. And audios also may play with a slight delay when we play them for the very first time in our game which combined with this bug can be very inconvenient:
https://forum.gdevelop.io/t/bug-sound-music-on-channel-is-stopped-condition-return-true-before-it-is-begin-to-play
Or when you use a timer instead and the audio is not finished playing by the time the timer kicks off because of the delay.

The problem is worst and more noticeable on slow devices.

It would be nice if GD would preload audio and fonts for us before loading a scene to avoid these problems.

Thanks.

1 Like

I think it warns already for sounds and music to load them all by displaying a loading screen, making global volume 0, start the sound and the Music, stop them all, restore the value of the volume and hiding the loading screen.

Yes, this is what I did eventually but displaying 2 loading screens one after the other is does not look very polished or to have just a blank screen for a few seconds either. If you have lots of audio to preload, it could take 4-5 seconds to completely preload them all on a slow device. I would prefer to wait this much longer on the initial loading screen instead of making a second one, but thank you for the tip. :+1:

1 Like

Hate to bump an old thread, however:
Once a sound is loaded into memory, is it only loaded for that specific channel?

e.g. If I preload a sound on channel 100, but then decide to play it on channel 1, will it not count as preloaded?

It looks like the sound and music cache in the sound manager is global, so maybe yes, but then maybe howler doesn’t.

1 Like

Actually, music is already preloaded (see GDevelop/runtimegame.js at 99312c71e0e7ec9385400901ff209196834cedd4 · 4ian/GDevelop · GitHub) they are in memory, but Howler didn’t process them already

Hmm… This feels like it’d be super important to figure out why it doesn’t load correctly.

Also, are we talking Music AND sounds? or just the (somewhat buggy) play music event?

We are talking about both

Just going to chime back in on this. Do we know if there’s any ideas/movement around this?

While I personally am using a workaround of a fade-in that I quickly play every sound effect and music on the same channel to load it into memory, this seems problematic long term for other users.

Hi all!

Excuse-me but i had no problems around the delay you speak about which is loaded and played without delay.

arthuro555 saying the music is pre-loaded maybe it is not effected I can’t remember I did not touch GD for a very long time, try it with a sound effect, explosion sound maybe played with a delay for the very first time. Especially on slow device. I mean very slow, old device if you have a $1000 smart phone, again it may be not effected because able to load a short sound super fast…

I would be surprised, devs are focusing on new features and game breaking bugs only, quality of life improvements like this are usually not a priority.

I’ll try it in my future game that i’ll start in little time.
Thanks.

From what I remember, music is rendered during buffering (but doesn’t work before user interaction) while sounds are rendered after buffering (delay for large files).

Ok I understand.

Thanks Gruk.