Godot Version
4.4
Question
I’m having a big issue with the web build of my project. Whenever I stop a sound effect (which is just a long and loud frequency being played), it causes an audible pop noise. This is because the sound goes from being loud to instantly stopping.
I have a very short fade in and fade out effect in my audio clip. Playing it from start to finish has no issues, but if I play it then stop in the middle, it pops.
I tried fading it out using a tween, but that also caused some crackling and popping.
var morse_audio_tween = get_tree().create_tween()
await morse_audio_tween.tween_property($AudioStreamPlayer, "volume_db", -80, 0.1).finished
morse_audio.stop()
I also tried to tween the audio bus volume, muting the audio bus, seeking to the end of the audio clip so it fades out and ends - but all those cause popping as well. At this point I’m getting desperate.
Is there any way to fade out a sound without causing any audio issues?