GDevelop music improvements testing

Hello GDevelop community!
I worked on “rewriting” the audio system to add some caching and actual preloading to it, and potentially memory optimizations. Sadly, with many changes come often bugs and regressions.
That is why I would appreciate if you could try the changes out!

To do so, simply start a preview (online builds won’t work) of one of your project using a test build, and check if everything is working properly. Try also to use the new preloading by checking preloading in the audio resource properties.
Please report any slowdown, crash, or unintended/changed behavior.
If everything is working fine, please also tell so that we know it got tested.

Here are the builds:
REDACTED LINKS, use the latest in the topic

Thank you very much, and happy development with GDevelop!

First form post so sorry if I brake any rules (I made sure to read the guidelines).

The issue I found was unless the music is preloaded. The song of the previous scene will play continue playing even after you switch scenes.

I tried it in my project.
Stop music and sounds on startup, no longer works, even without preload. Repeat music/sound, and change channel volume of music/sound did not work. Set global sound level worked.
I can’t say that my audio events are optimally arranged, but they work this way in b101.

Is there a reason why sounds and music are separate?
My experience was you can use it synonymous.

1 Like

Thank you both for your feedback! I’ll look into those issues.

The difference is that sounds are using a custom sound library for loading the audio file while the music use the built in browser method. I think the browser one can begin playing while not totally loaded.

Here is an updated build for windows (I didn’t get the time to build for other platforms): REDACTED LINK, use the latest in the topic

Could you try again with it please? Thank you very much in advance :slight_smile:

Repeat and Volume of “Play a music file on a channel” definitely does not work, not even in a new project.

1 Like

Weird, I cannot replicate this at all. It works without issues for me.

Ah I see. The problem seems to happen the first time the music is played as it probably is still loading and cannot set the stuff properly.

Ok I think I fixed all the issues, could you try again please? [Link removed, check the latest post for the latest link]

Works so far, but i found another situation where Repeat doesn’t work.
When you play a music on a channel. Then pause and start another scene. Then go back to the previous scene and play a music on a channel again, the music is only played once.
In b101 it works.
(Play the Music OF a channel after coming back, doesn’t seem to be an alternative. At the channel pause/change it forgets what was in a channel.)

Ok it took me 3 months but here I am again working on this.
I just tried to replicate what you said using those events:

For me, the music doesn’t resume at all, which is expected as the scene I opened had “Stop all sounds” checked in the properties, and stopping a sound on a channel makes the channel “empty” (the sound is removed from memory, unlike pause).
With the property unchecked, the sound also loops fine after returning to the scene.

Oh wait nevermind I managed to reproduce the issue by pressing m, then y, then m again with those events. I misinterpreted you instructions.

Here is a new build that should fix it:
Could you please try it? Thank you very much for your help so far.

Is fine now👍

“Post must be at least 20 characters”

1 Like

I ran through some of my test projects yesterday with this newest one and everything seems great, if not vastly improved (latency/restarts) compared to b105.

Thanks, sadly 4ian has discovered that playing a sound many time (for example shooting much in the game feel example) makes the sound not play at some point, and while investigating i found out that having one paused and can cause many issues due to how howler is made. This will be rather hard to fix, mainly because it doesn’t depends on us but on the howler maintainer and the changes aren’t likely to be integrated anytime soon.

Well, nevermind, 4ian being a genius software engineer he figured out a way to bypass the design of the library to make it do what we want so the issue is fixed.

The changes are done and will be present in next version. Thanks for your help!