Godot Audio
Paste the following prompt into your AI chat to install this skill:
Install @user_3c6cb52e/godot-audio-sh-0rkwcx according to https://skillhub.cn/install/skillhub.md.
About this skill
Problem
Godot audio code often trips up on small but expensive mistakes: treating volume_db as linear so 0.5 is nearly full volume; misspelling a bus name so get_bus_index() returns -1; retriggering the same AudioStreamPlayer and cutting off short SFX; forgetting loop settings on .ogg or .wav streams; missing an AudioListener3D / Camera3D or over-tight attenuation for 3D audio; and relying only on get_playback_position() for beat sync, which adds jitter.
How the Skill Works
This skill targets Godot 4.3+ and organizes audio implementation into node selection, stream setup, bus routing, decibel control, and beat compensation:
- Choose AudioStreamPlayer, AudioStreamPlayer2D, or AudioStreamPlayer3D based on whether the sound is positional.
- Assign an AudioStream, typically .ogg for music and loops, and .wav for short SFX.
- Route players to named buses such as Music or SFX, then configure volume, mute, solo, reverb, compressor, and other bus effects in the Audio panel.
- Map sliders with linear_to_db / db_to_linear, and drive bus volume_db and mute through AudioServer by bus index.
- For beat-accurate timing, add get_time_since_last_mix() and subtract get_output_latency() to reduce output-latency drift.
Boundaries and Notes
It covers in-engine playback, buses, effects, 3D audio, and timing, but not engine-agnostic adaptive music design, mixing philosophy, or external asset encoding. When wiring it up, avoid linear_to_db(0.0) returning -inf; clamp the linear value or special-case mute. For short SFX, use separate players, AudioStreamPolyphonic, or per-shot freed players.
Use Cases
- Wire one-shot UI, hit, and level-event SFX into Godot 4 gameplay nodes.
- Route music and SFX to Music or SFX buses, then tune dB volume and mute via AudioServer.
- Make 3D sounds attenuate with distance, then check AudioListener3D and attenuation settings.
- Align skill casts or actions to the beat using playback position, mix timing, and latency.
Best For
- Godot 4 client engineers: move audio from editor setup into code-controlled players, buses, and dB volume.
- Game technical artists: add bus effects such as reverb or compressor, and debug mute or attenuation issues.
- Rhythm-game developers: compensate output latency so hits, actions, and events stay on beat.
- Indie game developers: manage music, UI SFX, and 3D audio node choice, looping, and playback cutoff.
Related Skills
Automatically indexes Gradle-cached AAR/JAR dependency classes and returns library coordinates, versions, and public APIs by fully qualified name, using only the Python standard library.
Codifies AMT and YourMT3 training conventions, script patterns, hyperparameters, precision, checkpoints, and NaN safeguards.
Retrieve relevant chunks from a customer-managed PKM dataset by dataset_id and return concise, source-annotated answers.
Convert PRDs, user stories, or functional specs into prioritized test-point checklists covering functional, business-rule, boundary, exception, and non-functional dimensions.