So when I change a volume e.g. via animationplayer of music to fade in and fade out my soundtracks, there are weird cracks and pops sounds that appears, I have no idea how to handle that problem
AudioStreamPlayer crack/pop sounds while change volume in game
Strange, I have faded AudioStreamPlayer's by adjusting their volume DB in the editor and haven't had any issues with cracks and pop sounds. With the AnimationPlayer, are you just adding a keyframe with the volume_db
property?
I've had issues with cracking and popping in Godot if the audio has too much bass or tremble, where it would exceed the buffer limit, but not when fading. It might be the buffer is having an issue when fading the audio out. I don't remember right off what I did to fix it in Godot though. I think one way I fixed it was normalizing the audio and then just increase the volume_db
of the AudioStreamPlayer node. This made the audio file itself have a lower range, but because of the increase in volume_db
, it sounded almost exactly the same and avoided the popping sounds.
I think that is what I did, it's been awhile since I've had the audio issue so I may be misremembering :sweat_smile:
Yes I adding a keyframe with the volume_db property. You can also check that issue for example in that project when use slider in settings: https://github.com/Calinou/escape-space/tree/29b3d90e27b97a2f651ae040895d0efad8221ca6
Problem also appears when I change volume in the editor:
This is a known bug: https://github.com/godotengine/godot/issues/32882
See https://github.com/godotengine/godot/issues/32882#issuecomment-979746857 for a workaround.