Audio design

From huytran1120/vie-agentic-skills · View interactive version

Audio design is an AI agent skill from the GitHub repository huytran1120/vie-agentic-skills. Implement game audio practice — bus/mixer architecture and gain in decibels, ducking (sidechain), adaptive/dynamic music via layering and re-sequencing, SFX variation, and beat synchronization. Engine-neutral. Use when the user mentions audio mixing, audio buses, adaptive/dynamic music, ducking, SFX

How to use this skill

Skill file

Audio design

Game audio is a mixing graph plus a music system. Route every sound through a

small set of buses so you can balance and process groups; make music react to

play through layering and re-sequencing rather than looping one track. This skill

teaches the portable practice; bind it to godot-audio, Unity's AudioMixer, or

middleware (FMOD/Wwise) for concrete APIs.

When to use

compression, EQ) to groups of sounds.

When not to use: for the engine's concrete audio nodes/streams, use

godot-audio or the engine's audio skill. Loading/streaming and asset import are

engine concerns. For UI sliders that drive bus volume, see the engine UI skill.

Core workflow

  1. Lay out buses, not per-sound volume. A typical tree: `Master ← {Music,

SFX, Ambience, UI, Voice}`. Everything plays into a bus; the player's settings

sliders map to bus volumes. Never set hundreds of clip volumes by hand.

  1. Work in decibels, not linear. Perceived loudness is logarithmic. Volume

controls and automation should operate in dB; convert only at the edges.

  1. Leave headroom and hit a loudness target. Keep true peaks at or below -1 dBTP and

measure integrated loudness over a representative play session with an ITU-R BS.1770 meter.

Sony's ASWG-R001 recommendation, the usual reference, is -24 LUFS (±2) for console/PC

played on TVs and speakers and -18 LUFS (±2) for handheld/mobile. Music-streaming targets

such as -14 LUFS are not game targets.

  1. Duck competing sources with a sidechain compressor (or volume automation):

when voice/important SFX plays, the music bus dips, then recovers.

  1. Make music adaptive via vertical layering (stems faded in/out) and/or

horizontal re-sequencing (swap segments at musical boundaries). See the

reference.

  1. Vary repeated SFX with small random pitch/volume offsets and sample pools

so footsteps and hits don't sound robotic.

  1. Verify on real output. Listen on headphones and speakers; check that the

mix balances, ducking is audible but not pumping, and music transitions land

on the beat — never assume from the editor meters alone.

Patterns

Snippets are Godot 4.7 GDScript; the Unity 6.3 LTS and middleware equivalents are noted

under each one.

1. Bus routing and slider-to-gain mapping

# Route sounds to named buses; control GROUPS, not individual clips.
sfx_player.bus = &"SFX"
music_player.bus = &"Music"

# Map a 0..1 settings slider to bus gain. Squaring the slider first spreads the
# audible change over the whole travel; a raw linear-amplitude slider puts most of
# the change in the bottom fifth.
func set_bus_volume(bus_name: StringName, slider01: float) -> void:
    var idx := AudioServer.get_bus_index(bus_name)
    var gain := clampf(slider01, 0.0, 1.0)
    AudioServer.set_bus_mute(idx, gain <= 0.0)             # true silence at 0
    AudioServer.set_bus_volume_linear(idx, gain * gain)    # = set_bus_volume_db(idx, linear_to_db(gain * gain))
# WRONG: AudioServer.set_bus_volume_db(idx, slider01): "0.5" is +0.5 dB (no audible
# change) and 0 is 0 dB (full volume).

Unity 6.3 LTS: expose the group's Volume as a mixer parameter, then

mixer.SetFloat("MusicVolume", 20f * Mathf.Log10(Mathf.Max(gain * gain, 0.0001f))) (the mixer

floor is -80 dB). An AudioSource whose Output group is empty plays outside your mixer groups,

so no category slider or snapshot affects it: route every source.

2. Ducking via sidechain (music dips under voice)

A compressor on the music bus, keyed by the voice bus, lowers the music while dialogue plays and

releases afterwards. Starting values: threshold about -30 dB on the voice signal, ratio 4:1 to

8:1, attack as fast as the effect allows (up to ~10 ms), release 300-500 ms.

# Godot 4.7: AudioEffectCompressor reads its sidechain bus for threshold detection.
func _ready() -> void:
    var duck := AudioEffectCompressor.new()
    duck.sidechain = &"Voice"      # the bus that triggers the dip
    duck.threshold = -30.0         # dB, range -60..0
    duck.ratio = 8.0               # range 1..48
    duck.attack_us = 2000.0        # MICROseconds, range 20..2000 (2 ms is the maximum)
    duck.release_ms = 400.0        # milliseconds, range 20..2000
    AudioServer.add_bus_effect(AudioServer.get_bus_index(&"Music"), duck)

# No-compressor alternative: tween a dedicated "MusicDuck" bus that sits between
# Music and Master, so ducking never overwrites the player's Music slider.
func duck_music(active: bool) -> void:
    var idx := AudioServer.get_bus_index(&"MusicDuck")
    var from := AudioServer.get_bus_volume_db(idx)
    var to := -12.0 if active else 0.0
    create_tween().tween_method(
        func(db: float) -> void: AudioServer.set_bus_volume_db(idx, db), from, to, 0.25)

Unity 6.3 LTS: add a Duck Volume effect to the Music group and a Send effect on the Voice

group targeting it. FMOD Studio and Wwise have sidechain/auto-ducking on buses; prefer those over

script tweens when the project already uses middleware.

3. SFX variation (kill the "machine gun" repeat)

# Godot 4.7: AudioStreamRandomizer picks a take (no immediate repeats by default)
# and randomizes pitch and volume on every play. No per-shot node allocation.
func make_footsteps(samples: Array[AudioStream]) -> void:
    var rnd := AudioStreamRandomizer.new()
    for s in samples:
        rnd.add_stream(-1, s)                 # -1 appends; optional third arg = weight
    rnd.random_pitch_semitones = 1.0          # up to +/-1 semitone (about 6%)
    rnd.random_volume_offset_db = 2.0         # up to +/-2 dB
    $Footsteps.stream = rnd
    $Footsteps.max_polyphony = 4              # overlapping steps without new players

Unity 6.3 LTS has no built-in randomizer: keep an array of clips, pick one that differs from the

last, set pitch in a small range, and call PlayOneShot on a pooled AudioSource.

4. Beat-synced events (quantize to the music grid)

# Schedule gameplay/visuals on musical time, not frame time, so they land on beat.
const BPM := 120.0
const SECONDS_PER_BEAT := 60.0 / BPM

# What the player HEARS now: playback position, plus time since the last mix
# (the position only updates once per mixed chunk), minus output latency.
func song_time() -> float:
    return ($Music.get_playback_position() + AudioServer.get_time_since_last_mix()
            - AudioServer.get_output_latency())

func current_beat() -> int:
    return int(song_time() / SECONDS_PER_BEAT)

# Quantize an action to the NEXT beat boundary instead of firing immediately.
func time_until_next_beat() -> float:
    return SECONDS_PER_BEAT - fmod(song_time(), SECONDS_PER_BEAT)

Unity 6.3 LTS: read AudioSettings.dspTime and schedule with AudioSource.PlayScheduled(dspTime)

for sample-accurate starts.

Pitfalls

set_bus_volume_linear) and back with db_to_linear. A raw linear-amplitude

slider sounds almost unchanged over most of its travel and drops off at the

bottom; squaring (or cubing) the slider before conversion evens it out.

bloats save/settings. Mix on buses.

Godot player left on Master, ignores the category sliders. Route everything.

headroom; put a limiter on Master as a safety net, not as the mixer.

breathe. Lengthen release; lower ratio.

overwrites the player's setting. Duck a separate bus, or use the compressor.

segments that respond to state (see the reference).

position**, add the time since the last mix, and subtract output latency.

them leaks. Use max_polyphony/AudioStreamRandomizer, free on finished, or

pool them.

References

transition timing (bars/quantize), stingers, intensity mapping, and crossfades.

Related skills

VAS installation notes

Imported from gamedev-skills/awesome-gamedev-agent-skills at

19d93f97c9c1ea0f8b306e77aa81e0d3e352d3e9, Apache-2.0.

Copyright 2026 Abhishek Barali and the awesome-gamedev-agent-skills contributors.

The complete upstream LICENSE and NOTICE accompany this standalone skill.

Third-party notices, including the Go-Fonts license where provided, remain intact.

Only documented VAS naming, router-path adaptations and these notes differ;

supporting files and executable modes are preserved.

Use Copy Agent Prompt in the VAS catalog or ./vas install <canonical-id> --target <agent>.

VAS uses its existing agent-folder mapping and CLI-compatible receipt. Installing

a skill only copies/links its payload; it never runs bundled Python/Luau/Go code,

installs engines, SDKs, packages, plugins or MCP servers, connects accounts,

generates assets through paid services, uploads builds or publishes a game.

Review code and request permission before installation, execution, downloads,

external services, private-data submission, purchases or publishing.

Respect the existing project's pinned engine/dependency versions. Baselines in

the upstream runbooks are snapshots, not claims about the newest release.

Actual use may need the matching engine, Go/.NET/Luau/Node toolchain, SDK,

hardware or platform account. create-game-assets' optional image helpers need

Pillow>=10,<14; no Pillow or other runtime dependency is installed automatically.

Generated Ebitengine projects fetch their own Go modules only with approval;

the bundled Go-Fonts notice does not change the license of this runbook.

Storefront publishing, signing credentials and paid asset generation are separate,

explicitly authorized actions. Missing prerequisites or failed commands are errors,

not evidence that a game works or has shipped.

Collection names performance-optimization and godot-export mean VAS canonical IDs

gamedev-performance-optimization and gamedev-godot-export respectively, not the

unrelated existing application-performance or Blender-export skills.

Other source skill names retain their canonical IDs and installed folder names.

Cross-skill composition recommendations do not imply that other independent

skills or external tools have been installed. Each specialized skill includes

its own complete local references, helpers and assets. For automatic selection

across the collection, the separately installable router includes all 77 original

specialized payloads as read-only companions under bundled/skills/, with

RUNBOOK.md filenames rather than additional auto-discovered SKILL.md files.

Read only the selected companion and its references on demand; never execute

its helpers automatically. Bundled companions are references, not extra catalog

records or separately registered agent skills. External engines, documentation,

SDKs, services and generated project's dependencies remain separate prerequisites.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.