godot-audio
Agent skill fromgamedev-skills/awesome-gamedev-agent-skills
Play and mix audio in Godot 4.7: AudioStreamPlayer (2D/3D variants), audio buses with volume/mute and effects, music vs SFX routing, db/linear volume, and precise sync-to-beat playback timing. Use when playing sounds or music in a Godot project, routing AudioStreamPlayer nodes to buses, adjusting bus volume via AudioServer, or syncing gameplay to the beat.
How to install godot-audio
install godot-audio
# install the awesome-gamedev-agent-skills pack with the skills CLI
npx skills add gamedev-skills/awesome-gamedev-agent-skills# or add only this skill to Claude Code: copy the folder
skills/godot/godot-audio/
# into
~/.claude/skills/godot-audio/ (all projects)
.claude/skills/godot-audio/ (one project)
1# Godot Audio (4.x)23Play SFX and music, route them through buses, control volume in decibels, and time4gameplay to the beat. Targets **Godot 4.7**.56## When to use78- Use when playing sound effects or music, routing audio to buses (Master/Music/SFX),9 adjusting volume/mute from code, adding bus effects (reverb, compressor), positional 3D10 audio, or syncing events to music.1112**When *not* to use:** engine-agnostic audio *design* (adaptive music structure, mixing13philosophy, ducking patterns) → `audio-design`; importing/encoding assets outside Godot.1415## Core workflow16171. **Pick the player node:**18 - `AudioStreamPlayer` — non-positional (music, UI, global SFX).19 - `AudioStreamPlayer2D` / `AudioStreamPlayer3D` — positional; volume/pan from distance.202. **Assign an `AudioStream`** to `stream` (`.ogg` for music/loops, `.wav` for short SFX)21 and `play()`. Set `autoplay` for music that starts with the scene.223. **Route to a bus.** Set the player's `bus` to a named bus (e.g. `"Music"`, `"SFX"`).23 Define buses in the Audio panel (bottom dock); each can have volume, mute, solo, and24 effects.254. **Control volume in dB**, not linear (audio is logarithmic). `0 dB` = unchanged,26 `-80 dB` ≈ silent. Convert with `linear_to_db`/`db_to_linear`, or use the linear helpers27 (`volume_linear` on players, `AudioServer.set_bus_volume_linear()`), which convert for you.285. **Drive volume/mute from code** with `AudioServer` by bus index.29…
Excerpt shown under the repository's Apache-2.0 license.
