Underwater Muffled Music

HELLOOOOO GDEVELOP

I need help. So, in my game, I want to muffle the music when the player is in water. There are probably many solutions to this, like changing the song to a muffled version of it, but then the song would just start over again. Any solutions?

I would call it more workaround rather than solution

I would prepare 2 music files one normal and other muffled
And all you need to do is play them at the same time with some variables
For example
Play sound on channel 1 NormalMusic with volume NormalVolSoundVar
And
Play sound on channel 2 NormalMusic with volume MuffledVolSoundVar

Set NormalVolSoundVar to 100 at beginning of scene
And MuffledVolSoundVar to 0

Player gets into water you change them around
NormalVolSoundVar to 0
MuffledVolSoundVar to 100

You just made fake transition for your audio
Where you would reverse the process when player gets out of water
You could even tween these variables to make it more smooth instead of instant change

Edit part
I am not sure does changing variable would work alone
I always forget how sound works
You would need change sound on channel to these vars i think
Anyway it is easy to deduce
Where on other hand vars are only there if you have save system
Or care to tween variables for smooth transition
If not you could directly change volume on channels

@v9um channel index
I forgot to change it to 2 after i copy pasted text
Fixed that THX

1 Like

Dont forget to change the muffled channel offset to the original channel offset and vice versa so it doesnt start from the beginning.

1 Like