Audio crackling jssue

Godot Version

Godot 4.4

Question

Hi, I’m working on the menu settings for my first game.
The volume slider isn’t working properly—when I try to adjust it, the audio crackles.
I’ve looked around and found that some people had similar issues, but I still haven’t been able to fix it.
Has anyone else dealt with this before or knows how I could solve it?

Slider code:

func _on_mainvolslider_value_changed(value: float) -> void:
	var index = AudioServer.get_bus_index("Music") 
	AudioServer.set_bus_volume_db(index, linear_to_db(value))

Issue video: https://youtu.be/6zh6zli_4H4?si=Yzixc2yYR0hb9w-O

@GlobalScope.linear_to_db() Expects values between 0.0 to 1.0

Change your slider min and max values to those values.

1 Like

Bro! Thank you very much, it works.