Overview
Tested with: Godot 4.3+
Adding effects to an AudioBus applies them to all sounds passing through that bus at once. By combining effects, you can create any audio environment you need -- cave reverberations, muffled underwater sounds, radio-style processing, and more.
This article covers AudioBus layout design, configuring key effects like reverb, compressor, and EQ, and dynamic control via GDScript.
Designing the AudioBus Layout
Before applying effects, let's start by organizing your buses. Skip this step, and you'll end up with problems like reverb bleeding into your UI sounds when you only wanted it on the BGM.
Godot's audio system allows you to organize multiple buses by purpose, enabling batch effect application and volume adjustments later on.
Recommended Bus Structure
Master (Master output)
├── BGM ... Music
├── SFX ... Sound effects
├── Voice ... Voice / dialogue
└── Ambient ... Environmental sounds
Creating Buses
- Open the "Audio" tab at the bottom of the editor
- Click "Add Bus"
- Set the bus name (e.g.,
SFX) - Set Send to
Master(default) - Save as
audio_bus_layout.tres
AudioServer API Basics
Once your bus layout is set, you'll want to control it from code too -- think volume sliders in an options menu. The AudioServer API gives you programmatic access to volume, mute, and more.
# Get the bus index
var sfx_idx = AudioServer.get_bus_index("SFX")
# Set volume (in decibels)
AudioServer.set_bus_volume_db(sfx_idx, -6.0)
# Toggle mute
AudioServer.set_bus_mute(sfx_idx, true)
# Solo playback (for debugging)
AudioServer.set_bus_solo(sfx_idx, true)
Assigning Audio Sources to Buses
A bus layout is useless if your sounds don't actually route through it. Set the bus property on AudioStreamPlayer (including 2D/3D variants) to direct its output to the appropriate bus.
# Assign buses from script
$AudioStreamPlayer.bus = "SFX"
$BGMPlayer.bus = "BGM"
$FootstepPlayer.bus = "SFX"
You can also set the "Bus" property in the Inspector. If not specified, audio defaults to the Master bus.
Key Effects and Settings
With your bus layout in place, it's time to start adding effects. Godot provides multiple effects for crafting audio environments. Here we'll cover reverb, compressor, and EQ -- the three you'll reach for most often.
AudioEffectReverb
From cave echoes to the grand resonance of a cathedral, reverb is the go-to effect for conveying a space's size and character.
| Property | Description | Recommended Range |
|---|---|---|
room_size | Room size | 0.2 (small room) to 0.9 (cathedral) |
damping | High-frequency decay | 0.3 to 0.8 |
wet | Effect mix ratio | 0.1 to 0.5 |
dry | Dry signal mix ratio | 0.5 to 1.0 |
spread | Stereo width | 0.5 to 1.0 |
AudioEffectCompressor
Ever noticed that explosions blow out your speakers while footsteps are barely audible? A compressor evens out those volume differences. It's useful for normalizing SFX volume or boosting the overall loudness on the master bus.
| Property | Description | Recommended Value |
|---|---|---|
threshold | Volume at which compression starts | -20 to -10 dB |
ratio | Compression ratio | 2:1 to 4:1 |
attack_us | Time before compression starts | 5000 to 20000 us |
release_ms | Time before compression releases | 100 to 300 ms |
gain | Output gain | 0 to 6 dB |
AudioEffectEQ (Equalizer)
The equalizer adjusts volume per frequency band, giving you broad creative control -- boost the bass for impact, cut the highs to simulate underwater audio, and more. Choose from 6-band, 10-band, or 21-band variants.
# EQ10 band layout
# 0: 31Hz, 1: 62Hz, 2: 125Hz, 3: 250Hz, 4: 500Hz
# 5: 1kHz, 6: 2kHz, 7: 4kHz, 8: 8kHz, 9: 16kHz
# Boost the bass
var eq = AudioEffectEQ10.new()
eq.set_band_gain_db(0, 6.0) # 31Hz +6dB
eq.set_band_gain_db(1, 4.0) # 62Hz +4dB
eq.set_band_gain_db(2, 2.0) # 125Hz +2dB
Other Effects
| Effect | Use Case | Key Properties |
|---|---|---|
AudioEffectDelay | Echo / reverb trails | tap1_delay_ms, tap1_level_db, feedback_level_db |
AudioEffectChorus | Adds thickness to sound | voice_count, voice_rate_hz, voice_depth_ms |
AudioEffectLimiter | Prevents clipping | ceiling_db, threshold_db |
AudioEffectDistortion | Distortion / radio effect | mode, drive, pre_gain |
Recommended Effect Chains
Now that you know the individual effects, the next question is: what order should they go in? Effects within a bus are processed from top to bottom, and the wrong order can produce unintended results. Here are proven configurations for common use cases.
Recommended Master Bus Setup
Master Bus
├── 1. AudioEffectEQ10 ... Overall frequency balance
├── 2. AudioEffectCompressor ... Volume normalization
└── 3. AudioEffectLimiter ... Clipping prevention (ceiling: -0.5dB)
Recommended SFX Bus Setup
SFX Bus
├── 1. AudioEffectEQ6 ... Cut unnecessary low frequencies
└── 2. AudioEffectCompressor ... Reduce volume differences between SFX
Recommended Ambient Bus Setup
Ambient Bus
├── 1. AudioEffectReverb ... Add spatial reverberation
└── 2. AudioEffectChorus ... Add natural width
tips: Adding too many effects increases CPU load. Keep effects to the minimum necessary.
Dynamic Control with GDScript
Static editor configuration is just the beginning. You can also change effects on the fly during gameplay -- applying reverb when entering a cave, cutting highs when diving underwater. Let's see how to do this from script.
Adding Effects Dynamically
In this example, we add reverb to the SFX bus when the player enters a cave area, and remove it when they leave.
# Add reverb to the SFX bus
func enter_cave():
var sfx_idx = AudioServer.get_bus_index("SFX")
var reverb = AudioEffectReverb.new()
reverb.room_size = 0.8
reverb.wet = 0.3
reverb.damping = 0.5
AudioServer.add_bus_effect(sfx_idx, reverb)
# Remove the reverb (search by type for safe removal)
func exit_cave():
var sfx_idx = AudioServer.get_bus_index("SFX")
remove_effect_by_type(sfx_idx, AudioEffectReverb)
# Find and remove an effect by type from a bus
func remove_effect_by_type(bus_idx: int, effect_type) -> void:
for i in range(AudioServer.get_bus_effect_count(bus_idx) - 1, -1, -1):
if AudioServer.get_bus_effect(bus_idx, i) is effect_type:
AudioServer.remove_bus_effect(bus_idx, i)
return
Removing effects by index (e.g., remove_bus_effect(idx, count - 1)) is fragile -- if other effects were added afterward, you'd remove the wrong one. Searching by type as shown above is much safer.
Real-Time Effect Parameter Changes
Beyond adding and removing effects, you can also smoothly animate their parameters. Combine this with Tween to create natural audio transitions, such as gradually increasing reverb as the player moves deeper into a cave.
# Smoothly transition the reverb wet value with a Tween
func transition_reverb(target_wet: float, duration: float = 1.0):
var sfx_idx = AudioServer.get_bus_index("SFX")
var reverb = find_effect_by_type(sfx_idx, AudioEffectReverb)
if reverb:
var tween = create_tween()
tween.tween_property(reverb, "wet", target_wet, duration)
# Find an effect by type on a bus
func find_effect_by_type(bus_idx: int, effect_type) -> AudioEffect:
for i in range(AudioServer.get_bus_effect_count(bus_idx)):
var effect = AudioServer.get_bus_effect(bus_idx, i)
if effect is effect_type:
return effect
return null
Bus Volume Fading
Fading an entire bus is another technique you'll use frequently -- for BGM fade-outs during scene transitions or muting SFX on the pause screen.
# Fade bus volume in/out
func fade_bus(bus_name: String, target_db: float, duration: float = 0.5):
var idx = AudioServer.get_bus_index(bus_name)
if idx == -1:
return
var current_db = AudioServer.get_bus_volume_db(idx)
var tween = create_tween()
tween.tween_method(
func(db): AudioServer.set_bus_volume_db(idx, db),
current_db, target_db, duration
)
Effect Settings by Use Case
Finally, here's a reference table of commonly used effect configurations by scenario. When you're wondering "which effects fit this scene?", use these as a starting point and fine-tune from there.
| Scenario | Effects Used | Configuration Tips |
|---|---|---|
| Cave / underground | Reverb | room_size: 0.8, wet: 0.3, damping: 0.4 |
| Underwater | EQ + Reverb | Cut highs (4kHz+ at -12dB), increase reverb |
| Outdoor / fields | Reverb (light) | room_size: 0.3, wet: 0.1 |
| Radio / communicator | Distortion + EQ | mode: OVERDRIVE, keep only mid frequencies |
| Boss battle | Compressor | Boost loudness on the master bus |
| Menu screen | EQ + Limiter | Tone down BGM, make UI sounds stand out |
Summary
- Adding effects to an AudioBus applies them to all sounds passing through that bus at once
- Reverb is for spatial ambiance, Compressor for volume normalization, EQ for frequency balance
- The recommended processing order is EQ -> Compressor -> Reverb -> Limiter
- Use
AudioServer.add_bus_effect()to dynamically add/remove effects and switch audio environments per scene - Adding effects impacts CPU load, so keep them to the bare minimum