Audio Systems
Expert mixing, spatial, pooling, and interactive-music patterns for Godot's audio engine.
NEVER Do (Expert Audio Rules)
Mixing & Buses
- NEVER set bus volume with linear values —
set_bus_volume_db() is logarithmic. Use linear_to_db() for sliders OR everything will sound too loud until the last 5%.
- NEVER skip 'Bus Routing' — Playing music on the 'SFX' bus makes volume menus useless. Strictly route every player to its dedicated sub-bus (Music, SFX, UI, Voice).
- NEVER use 'Master' for gameplay sounds — Dedicate Master to final limiting. Route all gameplay to sub-groups so you can mute/duck categories.
Positional & Spatial
- NEVER use 3D players without an Attenuation Model — Default is NONE. If you don't set it to
Inverse Distance, a whisper on the other side of the map will be global volume.
- NEVER play 3D sounds exactly on top of the listener — Causes "Panning Jitter" where the sound snaps between Left/Right speakers. Offset by
0.1 units.
- NEVER forget Doppler for high-speed objects — A car flying by without
DOPPLER_TRACKING_PHYSICS_STEP feels flat and static.
Performance & Polish
- NEVER spam same-frame sounds — Playing 50 explosions at once causes constructive interference (clipping/distortion). Use a
Limiter (audio_voice_limiter_manager.gd).
- NEVER instantiate nodes for one-shots — Creating a node, playing a 0.5s clap, and
queue_free()ing causes frame-time spikes. Use a Pool.
- NEVER skip Crossfades/Transitions — Abrupt music cuts break immersion. Always use a 0.5s-1.0s
Tween to bridge tracks.
Decision Matrix: Which AudioStreamPlayer?
| Feature |
AudioStreamPlayer |
AudioStreamPlayer2D |
AudioStreamPlayer3D |
| Spatial |
Global |
2D panning |
3D positioning |
| Doppler |
No |
No |
Yes |
| Attenuation |
No |
Distance-based |
3D falloff |
| Reverb send |
No |
No |
Yes |
| Use for |
Music, UI, VO |
2D games |
3D games |
| Performance |
Fastest |
Medium |
Slowest |
Golden Path → Scripts
MANDATORY — open only the script that matches the row. Do not reinvent pools, duckers, or interactive graphs from memory.
Do NOT Load every script below for one mix task.
| Need |
Script |
| One-shot SFX spam / voice steal |
MANDATORY audio_voice_pool_manager.gd |
| Cap identical SFX (ear-bleed) |
MANDATORY audio_voice_limiter_manager.gd |
| Dialogue over music |
MANDATORY audio_bus_ducker_logic.gd |
| Bus layout / runtime mute |
audio_bus_manager.gd |
| Linear UI slider → dB |
audio_linear_volume_interpolator.gd |
| Wall muffling |
MANDATORY audio_occlusion_raycast.gd |
| Room reverb zones |
audio_environmental_reverb_zone.gd |
| Vertical intensity stems |
MANDATORY audio_interactive_music_manager.gd |
| Horizontal clip graph |
interactive_music_graph.gd + references/interactive-music-deep-dive.md |
| Bus / pool WHY |
references/audio-pooling-and-buses.md |
| Crossfade / BPM / duck |
references/music-transitions.md |
| Adaptive music player wrapper |
audio_adaptive_music_player.gd |
| Autoload SFX entry |
audio_manager.gd |
| Footstep surface banks |
audio_footstep_surface_selector.gd |
| Procedural hum / engine |
audio_procedural_generator_synth.gd |
| Spectrum → gameplay / VFX |
audio_reactive_visualizer_component.gd, audio_visualizer.gd |
| Dialogue subtitle sync |
subtitle_sync_system.gd |
Available Scripts (catalog)
audio_voice_pool_manager.gd
Priority voice pool with steal of lowest-priority oldest voice (hero voices protected).
audio_voice_limiter_manager.gd
Concurrency cap for identical SFX instances.
audio_bus_ducker_logic.gd
Sidechain-style dialogue-over-music ducking.
audio_bus_manager.gd
Runtime bus volume/mute helpers for Music/SFX/UI/Voice groups.
audio_manager.gd
Autoload entry for play-one-shot routing onto the pool.
audio_linear_volume_interpolator.gd
Musically-correct linear↔dB UI slider mapping.
audio_occlusion_raycast.gd
Raycast muffling via attenuation filter cutoff.
audio_environmental_reverb_zone.gd
Area3D-driven reverb/bus override zones.
audio_interactive_music_manager.gd
AudioStreamSynchronized vertical stem intensity.
interactive_music_graph.gd
AudioStreamInteractive horizontal clip graph.
audio_adaptive_music_player.gd
Adaptive music player wrapper for intensity-driven stems.
audio_footstep_surface_selector.gd
Physics-driven surface → sound-bank selection.
audio_procedural_generator_synth.gd
Realtime procedural tones for hums/engines/signals.
audio_reactive_visualizer_component.gd
FFT spectrum → gameplay/visual driver.
audio_visualizer.gd
Spectrum analyzer visualization helper.
subtitle_sync_system.gd
Playback-position-accurate subtitle sync (latency-compensated).
Expert Audio Patterns
Pooling (WHY)
Spawning AudioStreamPlayer.new() per footstep at 60 FPS ≈ 3600 nodes/minute and frame spikes. MANDATORY audio_voice_pool_manager.gd. Cap duplicate SFX with audio_voice_limiter_manager.gd — 50 same-frame explosions clip the mix.
Deep dive → audio-pooling-and-buses.md.
Bus architecture
Master = final limiter only. Gameplay → Music / SFX / UI / Voice. set_bus_volume_db(0.5) is wrong — use linear_to_db() for sliders.
Music transitions
Never hard-cut tracks — 0.5–2.0s Tween crossfade or BPM-aligned handoff. Vertical/horizontal adaptive scores → interactive-music-deep-dive.md, music-transitions.md.
Occlusion muffling
Ray source→listener; blocked → Tween attenuation_filter_cutoff_hz down — audio_occlusion_raycast.gd.
Subtitle sync (no timer drift)
pos = get_playback_position() + AudioServer.get_time_since_last_mix() - AudioServer.get_output_latency() — subtitle_sync_system.gd.
Reference
Progressive disclosure: open Official Documentation links only when researching a specific API; load Related Skills when routing to a peer domain — do not preload the whole lattice.
Official Documentation
- Audio (tutorial index) — Entry point for buses, streams, effects, sync, mic, and TTS before diving into class pages.
- Audio buses — Decibel scale, Master/sub-bus routing, and why linear slider values break mixing.
- Audio streams — AudioStreamPlayer / 2D / 3D roles, randomizers, and how streams reach buses.
- Audio effects — Bus FX chain (EQ, filters, reverb, compressor, limiter) for ducking and environment zones.
- Sync the gameplay with audio and music — Playback-position helpers (
get_time_since_last_mix, latency) for BPM and subtitle sync.
- Importing audio samples — WAV/Ogg/MP3 tradeoffs that decide pool size and CPU cost for SFX spam.
- AudioServer — Runtime bus volume, mute, effect add/remove, and spectrum analyzer instances.
- AudioStreamPlayer — Non-positional music/UI/voice player API used by pools and crossfade managers.
- AudioStreamPlayer3D — Attenuation models, Doppler, and filter cutoff for spatial SFX and occlusion.
- AudioStreamInteractive — Clip graph / switch modes for horizontal combat↔explore music transitions.
- AudioStreamSynchronized — Stem layering API (
set_sync_stream_volume) for vertical intensity mixes.
Related Skills
Prerequisites
- godot-project-foundations — Bus names, import defaults, and project audio latency settings must exist before runtime mix code.
- godot-autoload-architecture — Music/SFX pools and bus managers are almost always Autoloads; use this for singleton ownership and boot order.
- godot-gdscript-mastery — Typed Resources, signals, and await/Tween patterns underpin pooling, ducking, and interactive music graphs.
Complements
- godot-tweening — Crossfades, sidechain duck ramps, and occlusion cutoff sweeps should be Tween-driven, not per-frame lerps.
- godot-animation-player — Audio Playback + Call Method tracks keep dialogue VO and subtitles frame-locked across locales.
- godot-dialogue-system — Routes spoken lines to a Voice/Dialog bus and should trigger Music ducking from this skill’s bus helpers.
- godot-raycasting-queries — Occlusion muffling needs correct
PhysicsRayQueryParameters3D masks from source to listener.
- godot-shaders-basics — Spectrum analyzer magnitudes commonly drive shader uniforms or light energy for audio-reactive VFX.
- godot-ui-containers — Volume menus need linear→dB mapping (
linear_to_db) wired to bus indices, not raw slider values.
- godot-save-load-systems — Persist per-bus volume/mute so mixer choices survive relaunch without rewriting bus layout.
Downstream / consumers
- godot-performance-optimization — Escalate here when voice pools, polyphony, or mix-callback cost still show up in profilers after pooling.
- godot-monte-carlo-balancer — Use when SFX concurrency caps, “loudness budget,” or spam-vs-clarity tradeoffs need simulated balance passes (pairs with voice limiters).
- godot-genre-rhythm — Consumes sync-with-audio timing helpers for note windows and BPM-aligned transitions.
- godot-combat-system — Hit/explosion layers must share SFX bus routing plus voice stealing so combat never clips the mix.
Master
- godot-master — Library router and mirrored module entry; open when discovering which Domain Skill owns a cross-cutting audio concern.
1---2name: godot-audio-systems3description: Expert patterns for Godot audio including AudioStreamPlayer variants (2D positional, 3D spatial), AudioBus mixing architecture, dynamic effects (reverb, EQ,compression), audio pooling for performance, music transitions (crossfade, bpm-sync), and procedural audio generation. Use for music systems, sound effects, spatial audio, or audio-reactive gameplay. Trigger keywords: AudioStreamPlayer, AudioStreamPlayer2D, AudioStreamPlayer3D, AudioBus, AudioServer, AudioEffect, music_crossfade, audio_pool, positional_audio, reverb, bus_volume.4---5# Audio Systems67Expert mixing, spatial, pooling, and interactive-music patterns for Godot's audio engine.89## NEVER Do (Expert Audio Rules)1011### Mixing & Buses12- **NEVER set bus volume with linear values** — `set_bus_volume_db()` is logarithmic. Use `linear_to_db()` for sliders OR everything will sound too loud until the last 5%.13- **NEVER skip 'Bus Routing'** — Playing music on the 'SFX' bus makes volume menus useless. Strictly route every player to its dedicated sub-bus (Music, SFX, UI, Voice).14- **NEVER use 'Master' for gameplay sounds** — Dedicate Master to final limiting. Route all gameplay to sub-groups so you can mute/duck categories.1516### Positional & Spatial17- **NEVER use 3D players without an Attenuation Model** — Default is NONE. If you don't set it to `Inverse Distance`, a whisper on the other side of the map will be global volume.18- **NEVER play 3D sounds exactly on top of the listener** — Causes "Panning Jitter" where the sound snaps between Left/Right speakers. Offset by `0.1` units.19- **NEVER forget Doppler for high-speed objects** — A car flying by without `DOPPLER_TRACKING_PHYSICS_STEP` feels flat and static.2021### Performance & Polish22- **NEVER spam same-frame sounds** — Playing 50 explosions at once causes constructive interference (clipping/distortion). Use a `Limiter` (`audio_voice_limiter_manager.gd`).23- **NEVER instantiate nodes for one-shots** — Creating a node, playing a 0.5s clap, and `queue_free()`ing causes frame-time spikes. Use a Pool.24- **NEVER skip Crossfades/Transitions** — Abrupt music cuts break immersion. Always use a 0.5s-1.0s `Tween` to bridge tracks.2526---2728## Decision Matrix: Which AudioStreamPlayer?2930| Feature | AudioStreamPlayer | AudioStreamPlayer2D | AudioStreamPlayer3D |31|---------|------------------|---------------------|---------------------|32| **Spatial** | Global | 2D panning | 3D positioning |33| **Doppler** | No | No | Yes |34| **Attenuation** | No | Distance-based | 3D falloff |35| **Reverb send** | No | No | Yes |36| **Use for** | Music, UI, VO | 2D games | 3D games |37| **Performance** | Fastest | Medium | Slowest |3839## Golden Path → Scripts4041> **MANDATORY** — open only the script that matches the row. Do **not** reinvent pools, duckers, or interactive graphs from memory.42>43> **Do NOT Load** every script below for one mix task.4445| Need | Script |46|------|--------|47| One-shot SFX spam / voice steal | **MANDATORY** [audio_voice_pool_manager.gd](scripts/audio_voice_pool_manager.gd) |48| Cap identical SFX (ear-bleed) | **MANDATORY** [audio_voice_limiter_manager.gd](scripts/audio_voice_limiter_manager.gd) |49| Dialogue over music | **MANDATORY** [audio_bus_ducker_logic.gd](scripts/audio_bus_ducker_logic.gd) |50| Bus layout / runtime mute | [audio_bus_manager.gd](scripts/audio_bus_manager.gd) |51| Linear UI slider → dB | [audio_linear_volume_interpolator.gd](scripts/audio_linear_volume_interpolator.gd) |52| Wall muffling | **MANDATORY** [audio_occlusion_raycast.gd](scripts/audio_occlusion_raycast.gd) |53| Room reverb zones | [audio_environmental_reverb_zone.gd](scripts/audio_environmental_reverb_zone.gd) |54| Vertical intensity stems | **MANDATORY** [audio_interactive_music_manager.gd](scripts/audio_interactive_music_manager.gd) |55| Horizontal clip graph | [interactive_music_graph.gd](scripts/interactive_music_graph.gd) + [references/interactive-music-deep-dive.md](references/interactive-music-deep-dive.md) |56| Bus / pool WHY | [references/audio-pooling-and-buses.md](references/audio-pooling-and-buses.md) |57| Crossfade / BPM / duck | [references/music-transitions.md](references/music-transitions.md) |58| Adaptive music player wrapper | [audio_adaptive_music_player.gd](scripts/audio_adaptive_music_player.gd) |59| Autoload SFX entry | [audio_manager.gd](scripts/audio_manager.gd) |60| Footstep surface banks | [audio_footstep_surface_selector.gd](scripts/audio_footstep_surface_selector.gd) |61| Procedural hum / engine | [audio_procedural_generator_synth.gd](scripts/audio_procedural_generator_synth.gd) |62| Spectrum → gameplay / VFX | [audio_reactive_visualizer_component.gd](scripts/audio_reactive_visualizer_component.gd), [audio_visualizer.gd](scripts/audio_visualizer.gd) |63| Dialogue subtitle sync | [subtitle_sync_system.gd](scripts/subtitle_sync_system.gd) |6465## Available Scripts (catalog)6667### [audio_voice_pool_manager.gd](scripts/audio_voice_pool_manager.gd)68Priority voice pool with steal of lowest-priority oldest voice (hero voices protected).6970### [audio_voice_limiter_manager.gd](scripts/audio_voice_limiter_manager.gd)71Concurrency cap for identical SFX instances.7273### [audio_bus_ducker_logic.gd](scripts/audio_bus_ducker_logic.gd)74Sidechain-style dialogue-over-music ducking.7576### [audio_bus_manager.gd](scripts/audio_bus_manager.gd)77Runtime bus volume/mute helpers for Music/SFX/UI/Voice groups.7879### [audio_manager.gd](scripts/audio_manager.gd)80Autoload entry for play-one-shot routing onto the pool.8182### [audio_linear_volume_interpolator.gd](scripts/audio_linear_volume_interpolator.gd)83Musically-correct linear↔dB UI slider mapping.8485### [audio_occlusion_raycast.gd](scripts/audio_occlusion_raycast.gd)86Raycast muffling via attenuation filter cutoff.8788### [audio_environmental_reverb_zone.gd](scripts/audio_environmental_reverb_zone.gd)89Area3D-driven reverb/bus override zones.9091### [audio_interactive_music_manager.gd](scripts/audio_interactive_music_manager.gd)92`AudioStreamSynchronized` vertical stem intensity.9394### [interactive_music_graph.gd](scripts/interactive_music_graph.gd)95`AudioStreamInteractive` horizontal clip graph.9697### [audio_adaptive_music_player.gd](scripts/audio_adaptive_music_player.gd)98Adaptive music player wrapper for intensity-driven stems.99100### [audio_footstep_surface_selector.gd](scripts/audio_footstep_surface_selector.gd)101Physics-driven surface → sound-bank selection.102103### [audio_procedural_generator_synth.gd](scripts/audio_procedural_generator_synth.gd)104Realtime procedural tones for hums/engines/signals.105106### [audio_reactive_visualizer_component.gd](scripts/audio_reactive_visualizer_component.gd)107FFT spectrum → gameplay/visual driver.108109### [audio_visualizer.gd](scripts/audio_visualizer.gd)110Spectrum analyzer visualization helper.111112### [subtitle_sync_system.gd](scripts/subtitle_sync_system.gd)113Playback-position-accurate subtitle sync (latency-compensated).114115## Expert Audio Patterns116117### Pooling (WHY)118Spawning `AudioStreamPlayer.new()` per footstep at 60 FPS ≈ **3600 nodes/minute** and frame spikes. **MANDATORY** [audio_voice_pool_manager.gd](scripts/audio_voice_pool_manager.gd). Cap duplicate SFX with [audio_voice_limiter_manager.gd](scripts/audio_voice_limiter_manager.gd) — 50 same-frame explosions clip the mix.119120Deep dive → [audio-pooling-and-buses.md](references/audio-pooling-and-buses.md).121122### Bus architecture123Master = final limiter only. Gameplay → Music / SFX / UI / Voice. `set_bus_volume_db(0.5)` is wrong — use `linear_to_db()` for sliders.124125### Music transitions126Never hard-cut tracks — 0.5–2.0s Tween crossfade or BPM-aligned handoff. Vertical/horizontal adaptive scores → [interactive-music-deep-dive.md](references/interactive-music-deep-dive.md), [music-transitions.md](references/music-transitions.md).127128### Occlusion muffling129Ray source→listener; blocked → Tween `attenuation_filter_cutoff_hz` down — [audio_occlusion_raycast.gd](scripts/audio_occlusion_raycast.gd).130131### Subtitle sync (no timer drift)132`pos = get_playback_position() + AudioServer.get_time_since_last_mix() - AudioServer.get_output_latency()` — [subtitle_sync_system.gd](scripts/subtitle_sync_system.gd).133134## Reference135136> Progressive disclosure: open Official Documentation links only when researching a specific API; load Related Skills when routing to a peer domain — do not preload the whole lattice.137138### Official Documentation139- [Audio (tutorial index)](https://docs.godotengine.org/en/stable/tutorials/audio/index.html) — Entry point for buses, streams, effects, sync, mic, and TTS before diving into class pages.140- [Audio buses](https://docs.godotengine.org/en/stable/tutorials/audio/audio_buses.html) — Decibel scale, Master/sub-bus routing, and why linear slider values break mixing.141- [Audio streams](https://docs.godotengine.org/en/stable/tutorials/audio/audio_streams.html) — AudioStreamPlayer / 2D / 3D roles, randomizers, and how streams reach buses.142- [Audio effects](https://docs.godotengine.org/en/stable/tutorials/audio/audio_effects.html) — Bus FX chain (EQ, filters, reverb, compressor, limiter) for ducking and environment zones.143- [Sync the gameplay with audio and music](https://docs.godotengine.org/en/stable/tutorials/audio/sync_with_audio.html) — Playback-position helpers (`get_time_since_last_mix`, latency) for BPM and subtitle sync.144- [Importing audio samples](https://docs.godotengine.org/en/stable/tutorials/assets_pipeline/importing_audio_samples.html) — WAV/Ogg/MP3 tradeoffs that decide pool size and CPU cost for SFX spam.145- [AudioServer](https://docs.godotengine.org/en/stable/classes/class_audioserver.html) — Runtime bus volume, mute, effect add/remove, and spectrum analyzer instances.146- [AudioStreamPlayer](https://docs.godotengine.org/en/stable/classes/class_audiostreamplayer.html) — Non-positional music/UI/voice player API used by pools and crossfade managers.147- [AudioStreamPlayer3D](https://docs.godotengine.org/en/stable/classes/class_audiostreamplayer3d.html) — Attenuation models, Doppler, and filter cutoff for spatial SFX and occlusion.148- [AudioStreamInteractive](https://docs.godotengine.org/en/stable/classes/class_audiostreaminteractive.html) — Clip graph / switch modes for horizontal combat↔explore music transitions.149- [AudioStreamSynchronized](https://docs.godotengine.org/en/stable/classes/class_audiostreamsynchronized.html) — Stem layering API (`set_sync_stream_volume`) for vertical intensity mixes.150151### Related Skills152153#### Prerequisites154- [godot-project-foundations](https://github.com/thedivergentai/gd-agentic-skills/blob/main/skills/godot-project-foundations/SKILL.md) — Bus names, import defaults, and project audio latency settings must exist before runtime mix code.155- [godot-autoload-architecture](https://github.com/thedivergentai/gd-agentic-skills/blob/main/skills/godot-autoload-architecture/SKILL.md) — Music/SFX pools and bus managers are almost always Autoloads; use this for singleton ownership and boot order.156- [godot-gdscript-mastery](https://github.com/thedivergentai/gd-agentic-skills/blob/main/skills/godot-gdscript-mastery/SKILL.md) — Typed Resources, signals, and await/Tween patterns underpin pooling, ducking, and interactive music graphs.157158#### Complements159- [godot-tweening](https://github.com/thedivergentai/gd-agentic-skills/blob/main/skills/godot-tweening/SKILL.md) — Crossfades, sidechain duck ramps, and occlusion cutoff sweeps should be Tween-driven, not per-frame lerps.160- [godot-animation-player](https://github.com/thedivergentai/gd-agentic-skills/blob/main/skills/godot-animation-player/SKILL.md) — Audio Playback + Call Method tracks keep dialogue VO and subtitles frame-locked across locales.161- [godot-dialogue-system](https://github.com/thedivergentai/gd-agentic-skills/blob/main/skills/godot-dialogue-system/SKILL.md) — Routes spoken lines to a Voice/Dialog bus and should trigger Music ducking from this skill’s bus helpers.162- [godot-raycasting-queries](https://github.com/thedivergentai/gd-agentic-skills/blob/main/skills/godot-raycasting-queries/SKILL.md) — Occlusion muffling needs correct `PhysicsRayQueryParameters3D` masks from source to listener.163- [godot-shaders-basics](https://github.com/thedivergentai/gd-agentic-skills/blob/main/skills/godot-shaders-basics/SKILL.md) — Spectrum analyzer magnitudes commonly drive shader uniforms or light energy for audio-reactive VFX.164- [godot-ui-containers](https://github.com/thedivergentai/gd-agentic-skills/blob/main/skills/godot-ui-containers/SKILL.md) — Volume menus need linear→dB mapping (`linear_to_db`) wired to bus indices, not raw slider values.165- [godot-save-load-systems](https://github.com/thedivergentai/gd-agentic-skills/blob/main/skills/godot-save-load-systems/SKILL.md) — Persist per-bus volume/mute so mixer choices survive relaunch without rewriting bus layout.166167#### Downstream / consumers168- [godot-performance-optimization](https://github.com/thedivergentai/gd-agentic-skills/blob/main/skills/godot-performance-optimization/SKILL.md) — Escalate here when voice pools, polyphony, or mix-callback cost still show up in profilers after pooling.169- [godot-monte-carlo-balancer](https://github.com/thedivergentai/gd-agentic-skills/blob/main/skills/godot-monte-carlo-balancer/SKILL.md) — Use when SFX concurrency caps, “loudness budget,” or spam-vs-clarity tradeoffs need simulated balance passes (pairs with voice limiters).170- [godot-genre-rhythm](https://github.com/thedivergentai/gd-agentic-skills/blob/main/skills/godot-genre-rhythm/SKILL.md) — Consumes sync-with-audio timing helpers for note windows and BPM-aligned transitions.171- [godot-combat-system](https://github.com/thedivergentai/gd-agentic-skills/blob/main/skills/godot-combat-system/SKILL.md) — Hit/explosion layers must share SFX bus routing plus voice stealing so combat never clips the mix.172173#### Master174- [godot-master](https://github.com/thedivergentai/gd-agentic-skills/blob/main/skills/godot-master/SKILL.md) — Library router and mirrored module entry; open when discovering which Domain Skill owns a cross-cutting audio concern.