All skills
thedivergentai avatar

/godot-audio-systems

@9d6e91e

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.

Use this Skill: https://skilld.dev/gh/thedivergentai/gd-agentic-skills/godot-audio-systems

This session only. Nothing lands on disk.

referencesaudio-pooling-and-buses.md

≈439 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Audio pooling and bus architecture

Pooling anti-pattern (WHY)

# BAD: 60 new nodes/sec at 60 FPS → ~3600 allocations/minute + frame spikes
func play_footstep() -> void:
    var player := AudioStreamPlayer.new()
    add_child(player)
    player.stream = load("res://audio/footstep.ogg")
    player.finished.connect(player.queue_free)
    player.play()

Fix: Pre-allocate a round-robin pool — audio_voice_pool_manager.gd. Cap identical SFX with audio_voice_limiter_manager.gd to avoid constructive clipping when 50 explosions stack.

Bus layout

Master (limiter only)
├── Music
├── SFX
├── UI
└── Voice
  • Never route gameplay to Master — mute/duck categories independently.
  • set_bus_volume_db() is logarithmic; UI sliders need linear_to_db() — audio_linear_volume_interpolator.gd.
# BAD
AudioServer.set_bus_volume_db(music_idx, 0.5)

# GOOD
AudioServer.set_bus_volume_db(music_idx, linear_to_db(0.5))

3D spatial gotchas

Issue Fix
Whisper heard globally Set attenuation_model = ATTENUATION_INVERSE_DISTANCE
Panning jitter on listener Offset source by ~0.1 units from camera
Flat fly-by doppler_tracking = DOPPLER_TRACKING_PHYSICS_STEP

Godot 4.7

AudioStreamPlayer.area_mask defaults to 0 — set layer 1 (or your bus layer) when using Area audio overrides.

Far-audio cull

Stop AudioStreamPlayer3D when listener distance > max_distance * 1.5 to skip inaudible mix work.

Edge cases

  1. Stream assigned?
  2. Bus muted?
  3. volume_db < -60 effectively silent

Source: SKILL.md on GitHub

No alerts17d4 checks · Risk SAFE
  • Gen Agent Trust Hub17d

    The skill provides a comprehensive set of scripts and patterns for managing audio in the Godot game engine, including voice pooling, spatial audio, and music transitions. No security issues were detected; all scripts follow best practices for game development and use standard Godot APIs.

  • Socket17d

    No alerts

  • Snyk17d

    Risk: LOW · No issues

  • Runlayer7mo

    1/4 files flagged

Signed by skilld at 9d6e91e. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 3 weeks ago.

Activeupdated 2 months ago

README badge

README badge for thedivergentai/gd-agentic-skills/godot-audio-systems