godot-audio-sofw
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "godot-audio-sofw" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-f243075bf227914666ca31df43b88fe44dd05168f41b8404209f13fa275e8bfb. Verify the upstream source and version against https://skillhub.cn/skills/user_3c6cb52e/godot-audio-sofw before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
skillhub.cn
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
An audio-focused skill for the Godot engine, intended to help AI agents efficiently complete Godot audio-related tasks by providing dedicated support and workflow guidance.
Introduction source: third_party · user_3c6cb52e · 1.0.0 Reference
SkillPi interpretation
- Tasks
- Play SFX and music, route them through buses, control volume in decibels, and time gameplay to the beat. Targets **Godot 4.3+**.
- Audience
- Use when playing sound effects or music, routing audio to buses (Master/Music/SFX), 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.
- Testing
- Not tested
Browse files
Frontmatter
name: Godot音频
slug: godot-audio
version: 1.0.0
displayName: Godot音频
description: >
Godot音频专用技能,帮助AI Agent高效完成相关任务。
summary: "Godot音频专用技能,帮助AI Agent高效完成相关任务。"
license: Apache-2.0
category: 游戏开发
framework:
- Claude Code
- Codex
- Hermes Agent
- OpenClaw
- QClaw
- WorkBuddy
platform: multi-platform
homepage: https://github.com/1991513ccie-png
repository: https://github.com/1991513ccie-pngGodot Audio (4.x)
Play SFX and music, route them through buses, control volume in decibels, and time gameplay to the beat. Targets Godot 4.3+.
When to use
- Use when playing sound effects or music, routing audio to buses (Master/Music/SFX), 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.
Core workflow
- Pick the player node:
AudioStreamPlayer— non-positional (music, UI, global SFX).AudioStreamPlayer2D/AudioStreamPlayer3D— positional; volume/pan from distance.
- Assign an
AudioStreamtostream(.oggfor music/loops,.wavfor short SFX) andplay(). Setautoplayfor music that starts with the scene. - Route to a bus. Set the player's
busto a named bus (e.g."Music","SFX"). Define buses in the Audio panel (bottom dock); each can have volume, mute, solo, and effects. - Control volume in dB, not linear (audio is logarithmic).
0 dB= unchanged,-80 dB≈ silent. Convert withlinear_to_db/db_to_linear. - Drive volume/mute from code with
AudioServerby bus index. - For rhythm, compute precise playback time using output latency compensation.
Patterns
1. One-shot SFX (fire-and-forget)
@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`.
2. Set a bus's volume and mute via AudioServer
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)
3. Crossfade between two music tracks
@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
4. Beat-accurate timing (compensate for output latency)
@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()
Pitfalls
- Treating volume as linear.
volume_db/set_bus_volume_dbare decibels. Settingvolume_db = 0.5is nearly full volume, not half. Map sliders withlinear_to_db. linear_to_db(0.0)is-inf. Clamp the linear value to a small minimum (e.g.0.0001) before converting, or special-case 0 → mute.- Bus name typos fail quietly.
get_bus_index("Muisc")returns-1; calls then error or no-op. Match the exact bus name from the Audio panel. - Short SFX cut off when the same player is retriggered. Use separate players, an
AudioStreamPolyphonic, orAudioStreamPlayerper-shot freed onfinished. - Music doesn't loop unless the import/stream loop is enabled (
.oggimport has a Loop option;AudioStreamWAVhasloop_mode). - Syncing to
get_playback_position()alone is jittery — it updates per audio mix, not per frame; addget_time_since_last_mix()and subtractget_output_latency(). - 3D audio inaudible → no
AudioListener3D/Camera3Dto hear it, ormax_distance/ attenuation too tight, or wrong bus muted.
References
- For the bus layout (
.tres), adding effects (reverb/compressor/EQ) and side-chain ducking,AudioStreamPolyphonic/AudioStreamInteractive, microphone capture, and procedural audio withAudioStreamGenerator, readreferences/buses-and-effects.md.
Related skills
audio-design— engine-agnostic adaptive music, mixing, and ducking practice.godot-animation— syncing animation/Tween toget_playback_position().godot-ui-control— volume sliders wired toAudioServer.
Current listing version
1.0.0
Safety and assessment details
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 针对 Godot 游戏引擎的音频处理,提供具体工作流和代码示例
- 涵盖音效、音乐、总线控制、3D 音频等核心场景,实用性强
Highlights
- 触发词精准完整,'When to use' 和 'When not to use' 清晰界定边界
- 覆盖多种变体,如音效播放、音量控制、节拍同步等
Areas to improve
-
When to Use 章节标题大小写不一致 Reported severity: Minor
文档中存在 'When to use' 章节,但标题大小写与常规规范不一致
Recommendation: 建议统一为 'When to Use' 以符合文档规范
Highlights
- 文档结构清晰,包含工作流、模式、陷阱等完整章节
- 提供端到端代码示例,frontmatter 完整
Areas to improve
-
引用文件缺失 Reported severity: Major
文档中引用了 'references/buses-and-effects.md' 文件,但未传入该文件
Recommendation: 请补充被引用的文件,或移除引用以避免用户困惑
Highlights
- 工具来源明确(Godot 4.3+),参数正确
- 覆盖主要异常处理,如音量转换、静音处理、总线名称错误等
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
These common operations were not identified in the main document. This does not mean no permissions or risks exist.
Domains or addresses referenced in the document
These addresses may be documentation links or examples, not an approved network allowlist. Verify actual destinations and outgoing data before use.
- github.com
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.