Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | deathvulture | |
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.
Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | deathvulture | |
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.
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
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)