Mute all sound.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By deathvulture
:warning: Old Version Published before Godot 3 was released.

Is there a way to mute all sound like setting a master volume to 0?

Thanks in advance.

:bust_in_silhouette: Reply From: ingo_nikot

I did try these on an demo Project and they worked for me:
for music:

AudioServer.set_stream_global_volume_scale(0)

for sound effects:

AudioServer.set_fx_global_volume_scale(0)

the scale ranges from 0 to 1.0.

For Godot 3.0, refer to this: Change "global" volume in 3.0 - Archive - Godot Forum

Anaxagor | 2019-02-07 18:41

:bust_in_silhouette: Reply From: azuledev

for mute bus

var master_sound = AudioServer.get_bus_index("Master")
AudioServer.set_bus_mute(master_sound, true)

or set volume with

var volume_db = -40;
AudioServer.set_bus_volume_db(master_sound, volume_db)