Global audio settings?

Godot Version

4.5 Stable

Question

How would I make a global audio switch? Note that I’ve already pretty much finished my game, and there is not a global audio controller, however, every piece of audio in the game uses the same “Master” bus. Is it possible to set the volume of an audio bus with code?

Yes, you can set a bus volume with AudioServer.set_bus_volume_linear or AudioServer.set_bus_volume_db

var master_index := AudioServer.get_bus_index("Master")
AudioServer.set_bus_volume_linear(master_index, 0.5) # half volume