ai-behavior-trees-util…
Build a production behavior-tree runtime (Blackboard, action/condition leaves, sequence/selector/parallel composites, decorators) and a Utility AI system…
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
$ npx -y skills add gamedev-skills/awesome-gamedev-agent-skills --skill godot-audio --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/godot-audioContext preview
The summary Claude sees to decide when to auto-load this skill.
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
name: godot-audio description: > 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.
Play SFX and music, route them through buses, control volume in decibels, and time gameplay to the beat. Targets **Godot 4.7**.
adjusting volume/mute from code, adding bus effects (reverb, compressor), positional 3D audio, or syncing events to music.
**When *not* to use:** engine-agnostic audio *design* (adaptive music structure, mixing philosophy, ducking patterns) → `audio-design`; importing/encoding assets outside Godot.
1. **Pick the player node:**
2. **Assign an `AudioStream`** to `stream` (`.ogg` for music/loops, `.wav` for short SFX) and `play()`. Set `autoplay` for music that starts with the scene. 3. **Route to a bus.** Set the player's `bus` to a named bus (e.g. `"Music"`, `"SFX"`). Define buses in the Audio panel (bottom dock); each can have volume, mute, solo, and effects. 4. **Control volume in dB**, not linear (audio is logarithmic). `0 dB` = unchanged, `-80 dB` ≈ silent. Convert with `linear_to_db`/`db_to_linear`. 5. **Drive volume/mute from code** with `AudioServer` by bus index. 6. **For rhythm**, compute precise playback time using output latency compensation.
@onready var sfx: AudioStreamPlayer = $Sfx # stream assigned in the editor
func play_jump() -> void:
sfx.pitch_scale = randf_range(0.95, 1.05) # slight variation avoids fatigue
sfx.play()
# For many overlapping copies, use an AudioStreamPlayer with an
# AudioStreamPolyphonic stream, or spawn short-lived players and free on `finished`.func set_music_volume(linear_0_to_1: float) -> void:
var bus := AudioServer.get_bus_index("Music")
# Convert a 0..1 slider to decibels; clamp avoids -inf at 0.
AudioServer.set_bus_volume_db(bus, linear_to_db(maxf(linear_0_to_1, 0.0001)))
func toggle_sfx(muted: bool) -> void:
AudioServer.set_bus_mute(AudioServer.get_bus_index("SFX"), muted)@onready var a: AudioStreamPlayer = $MusicA
@onready var b: AudioStreamPlayer = $MusicB
func crossfade_to(stream: AudioStream, secs := 1.5) -> void:
b.stream = stream
b.volume_db = -40.0
b.play()
var tw := create_tween().set_parallel(true)
tw.tween_property(a, "volume_db", -40.0, secs) # fade out current
tw.tween_property(b, "volume_db", 0.0, secs) # fade in next
tw.chain().tween_callback(a.stop)
var tmp := a; a = b; b = tmp # swap roles@onready var music: AudioStreamPlayer = $Music
func get_playback_time() -> float:
# Add time since the last audio mix, subtract output latency, for sub-frame accuracy.
var t := music.get_playback_position() + AudioServer.get_time_since_last_mix()
return t - AudioServer.get_output_latency()`volume_db = 0.5` is nearly full volume, not half. Map sliders with `linear_to_db`.
`0.0001`) before converting, or special-case 0 → mute.
or no-op. Match the exact bus name from the Audio panel.
`AudioStreamPolyphonic`, or `AudioStreamPlayer` per-shot freed on `finished`.
Loop option; `AudioStreamWAV` has `loop_mode`).
not per frame; add `get_time_since_last_mix()` and subtract `get_output_latency()`.
attenuation too tight, or wrong bus muted.
ducking, `AudioStreamPolyphonic`/`AudioStreamInteractive`, microphone capture, and procedural audio with `AudioStreamGenerator`, read `references/buses-and-effects.md`.
<img src="docs/assets/banner.png" width="820" alt="awesome-gamedev-agent-skills — game-dev skills for AI coding agents.
Repo: gamedev-skills/awesome-gamedev-agent-skills
Build a production behavior-tree runtime (Blackboard, action/condition leaves, sequence/selector/parallel composites, decorators) and a Utility AI system…
Implement game audio practice — bus/mixer architecture and gain in decibels, ducking (sidechain), adaptive/dynamic music via layering and re-sequencing, SFX…
Build game cameras that feel good — 2D follow with a deadzone, look-ahead, smoothing, and level-bounds clamping; 3D third-person orbit with collision and…
Plan, generate, source, normalize, and validate cohesive visual game assets. Use for art direction, style bibles, sprites, tilesets, backgrounds, UI art,…
Build branching dialogue and narrative — a node/choice graph with conditions, variables, and localization hooks — and choose between authoring tools Ink and…
Design NPC and enemy decision-making with finite state machines, behavior trees, steering behaviors, and A* pathfinding — engine-neutral algorithms that pair…