All 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.

Use this Skill: https://skilld.dev/gh/gamedev-skills/awesome-gamedev-agent-skills/godot-audio

This session only. Nothing lands on disk.

referencesbuses-and-effects.md

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

Audio buses & effects reference (Godot 4.7)

Depth companion to godot-audio.

The bus layout

Buses are configured in the editor's Audio panel (bottom dock) and saved as a bus layout resource (default_bus_layout.tres by default; set in Project Settings > Audio).

  • Master always exists and is the final output. Every other bus routes to Master (or to another bus via Send).
  • Add buses like Music, SFX, UI, Ambience. Set each player node's bus to route.
  • Per bus: volume (dB), mute, solo, bypass effects, and a chain of effects.

AudioServer API

var i := AudioServer.get_bus_index("Music")
AudioServer.set_bus_volume_db(i, linear_to_db(0.8))
AudioServer.set_bus_mute(i, true)
AudioServer.set_bus_solo(i, true)
AudioServer.get_bus_count()
AudioServer.add_bus(at_position)              # runtime bus creation
AudioServer.set_bus_send(i, "Master")
AudioServer.add_bus_effect(i, AudioEffectReverb.new())
AudioServer.get_bus_effect(i, effect_idx)
AudioServer.set_bus_effect_enabled(i, effect_idx, false)
AudioServer.get_output_latency()
AudioServer.get_time_since_last_mix()

Volume helpers: linear_to_db(linear) and db_to_linear(db).

Effects

Add AudioEffect* resources to a bus (editor or add_bus_effect):

  • AudioEffectReverb, AudioEffectDelay, AudioEffectChorus, AudioEffectDistortion.
  • AudioEffectEQ6/EQ10/EQ21, AudioEffectLowPassFilter, AudioEffectHighPassFilter.
  • AudioEffectCompressor, AudioEffectLimiter (mastering).
  • AudioEffectPitchShift, AudioEffectSpectrumAnalyzer (for visualizers/beat detection).
  • AudioEffectCapture / AudioEffectRecord (read/record bus output).

Side-chain ducking (music dips under dialogue/SFX)

  1. Put music on a Music bus and add an AudioEffectCompressor to it.
  2. Set the compressor's Sidechain to the bus whose loudness should trigger ducking (e.g. Voice). When Voice is loud, the compressor lowers Music.
  3. Tune threshold/ratio/attack/release for a natural dip and recovery.

Polyphony and interactive music

  • AudioStreamPolyphonic — one player that can play many overlapping streams; grab a AudioStreamPlaybackPolyphonic from get_stream_playback() and call play_stream(...).
  • AudioStreamInteractive — define clips and transitions for adaptive music that switches between sections on cue (4.7). AudioStreamSynchronized plays layered stems together.
  • AudioStreamRandomizer — pick a random stream/pitch per play (great for footsteps).

Positional audio (2D/3D)

  • AudioStreamPlayer2D: max_distance, attenuation, panning_strength, area_mask.
  • AudioStreamPlayer3D: unit_size, max_distance, attenuation_model (inverse/inverse-square/log/disabled), panning_strength, doppler via the player or camera. A Camera3D acts as the default listener; add an AudioListener3D to override.

Procedural / generated audio

AudioStreamGenerator + AudioStreamGeneratorPlayback.push_frame(Vector2) lets you push raw stereo samples for synthesis. Set mix_rate and buffer_length; keep the buffer filled in _process to avoid underruns.

Sync-to-beat recipe

const BPM := 120.0
var sec_per_beat := 60.0 / BPM
var last_beat := -1

func _process(_d: float) -> void:
    var t := music.get_playback_position() + AudioServer.get_time_since_last_mix() \
             - AudioServer.get_output_latency()
    var beat := int(t / sec_per_beat)
    if beat != last_beat:
        last_beat = beat
        _on_beat(beat)        # spawn, flash, or step a rhythm here

Source: SKILL.md on GitHub

No alerts1mo3 checks · Risk SAFE
  • Gen Agent Trust Hub1mo

    This skill provides safe and standard instructions for managing audio systems in Godot 4.7, including bus routing, volume control, and beat-accurate timing.

  • Socket1mo

    No alerts

  • Snyk1mo

    Risk: LOW · No issues

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

Last checked against GitHub 3 days ago.

Activeupdated 2 months ago

README badge

README badge for gamedev-skills/awesome-gamedev-agent-skills/godot-audio