$npx -y skills add thedivergentai/GD-Agentic-Skills --skill godot-audio-systemsExpert 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 f
| 1 | # Audio Systems |
| 2 | |
| 3 | Expert guidance for Godot's audio engine and mixing architecture. |
| 4 | |
| 5 | ## NEVER Do (Expert Audio Rules) |
| 6 | |
| 7 | ### Mixing & Buses |
| 8 | - **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%. |
| 9 | - **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). |
| 10 | - **NEVER use 'Master' for gameplay sounds** — Dedicate Master to final limiting. Route all gameplay to sub-groups so you can mute/duck categories. |
| 11 | |
| 12 | ### Positional & Spatial |
| 13 | - **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. |
| 14 | - **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. |
| 15 | - **NEVER forget Doppler for high-speed objects** — A car flying by without `DOPPLER_TRACKING_PHYSICS_STEP` feels flat and static. |
| 16 | |
| 17 | ### Performance & Polish |
| 18 | - **NEVER spam same-frame sounds** — Playing 50 explosions at once causes constructive interference (clipping/distortion). Use a `Limiter` (`audio_voice_limiter_manager.gd`). |
| 19 | - **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. |
| 20 | - **NEVER skip Crossfades/Transitions** — Abrupt music cuts break immersion. Always use a 0.5s-1.0s `Tween` to bridge tracks. |
| 21 | |
| 22 | --- |
| 23 | |
| 24 | ## Godot 4.7: Audio Breaking Changes |
| 25 | |
| 26 | - `AudioEffectSpectrumAnalyzer.tap_back_pos` **removed** — migrate analyzers to alternative tap APIs. |
| 27 | - `AudioStreamPlayer` default `area_mask` is now **0** (disabled), not layer 1. If using `Area2D`/`Area3D` `audio_bus_override`, explicitly set `area_mask` to layer 1 or your bus layer. |
| 28 | |
| 29 | ## Available Scripts |
| 30 | |
| 31 | > **MANDATORY**: Read the appropriate script before implementing the corresponding pattern. |
| 32 | |
| 33 | ### [audio_voice_pool_manager.gd](scripts/audio_voice_pool_manager.gd) |
| 34 | Expert high-performance voice pooler with priority-based 'voice stealing' logic. |
| 35 | |
| 36 | ### [audio_occlusion_raycast.gd](scripts/audio_occlusion_raycast.gd) |
| 37 | Professional Raycast-based audio occlusion for dynamic muffling behind walls. |
| 38 | |
| 39 | ### [audio_interactive_music_manager.gd](scripts/audio_interactive_music_manager.gd) |
| 40 | Manager for vertical music layering using AudioStreamSynchronized for dynamic intensity. |
| 41 | |
| 42 | ### [audio_reactive_visualizer_component.gd](scripts/audio_reactive_visualizer_component.gd) |
| 43 | Expert FFT spectrum analysis component for driving logic-to-data visuals. |
| 44 | |
| 45 | ### [audio_bus_ducker_logic.gd](scripts/audio_bus_ducker_logic.gd) |
| 46 | Professional sidechain-style bus ducking (Dialogue-over-Music). |
| 47 | |
| 48 | ### [audio_procedural_generator_synth.gd](scripts/audio_procedural_generator_synth.gd) |
| 49 | Expert real-time synthesizer for procedural hums, engines, and signals. |
| 50 | |
| 51 | ### [audio_environmental_reverb_zone.gd](scripts/audio_environmental_reverb_zone.gd) |
| 52 | Dynamic reverb/bus effect management via Area3D trigger zones. |
| 53 | |
| 54 | ### [audio_voice_limiter_manager.gd](scripts/audio_voice_limiter_manager.gd) |
| 55 | Concurrency manager that prevents 'Ear Bleed' by capping identical SFX instances. |
| 56 | |
| 57 | ### [audio_linear_volume_interpolator.gd](scripts/audio_linear_volume_interpolator.gd) |
| 58 | Expert helper for smooth, musically-accurate UI volume slider mapping. |
| 59 | |
| 60 | ### [audio_footstep_surface_selector.gd](scripts/audio_footstep_surface_selector.gd) |
| 61 | Physics-driven surface detection and sound-bank selector for footsteps. |
| 62 | |
| 63 | --- |
| 64 | |
| 65 | ## AudioStreamPlayer Variants |
| 66 | |
| 67 | ### AudioStreamPlayer (Global/UI) |
| 68 | |
| 69 | ```gdscript |
| 70 | # No spatial positioning, same volume everywhere |
| 71 | # Use for: Music, UI sounds, voiceovers |
| 72 | |
| 73 | @onready var music := AudioStreamPlayer.new() |
| 74 | |
| 75 | func _ready() -> void: |
| 76 | music.stream = load("res://audio/music_main.ogg") |
| 77 | music.volume_db = -10 # Quieter |
| 78 | music.autoplay = false |
| 79 | music.bus = "Music" # Route to Music bus |
| 80 | add_child(music) |
| 81 | music.play() |
| 82 | ``` |
| 83 | |
| 84 | ### AudioStreamPlayer2D (Positional) |
| 85 | |
| 86 | ```gdscript |
| 87 | # 2D panning based on distance from camera |
| 88 | # Use for: 2D games, top-down audio cues |
| 89 | |
| 90 | extends Area2D |
| 91 | |
| 92 | @onready var footstep := AudioStreamPlayer2D.new() |
| 93 | |
| 94 | func _ready() -> void: |
| 95 | footstep.stream = load("res://audio/footstep.ogg") |
| 96 | footstep.max_distance = 500 # Audible range (pixels) |
| 97 | footstep.attenua |