[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M79NXPNSH06WSG6MN3TF1HSM":3,"skill-same:01M79NXPNSH06WSG6MN3TF1HSM":51},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":14,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":29,"updatedAt":30,"install":31,"resources":44},"01M79NXPNSH06WSG6MN3TF1HSM","godot-audio",null,"Play and mix audio in Godot 4.7: AudioStreamPlayer (2D\u002F3D variants), audio buses with volume\u002Fmute and effects, music vs SFX routing, db\u002Flinear 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.","JunMystery\u002FAgent-Guidance","JunMystery","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F161468934?v=4","01M79MTMV8F0BY8NK1A92RA8A0","Jun","01M79MTMWCFBKPHN5B25E6V20B",0,"MIT","https:\u002F\u002Fgithub.com\u002FJunMystery\u002FAgent-Guidance\u002Fblob\u002Fmain\u002Fskills\u002Fgodot-audio\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: godot-audio\ndescription: >\n  Play and mix audio in Godot 4.7: AudioStreamPlayer (2D\u002F3D variants), audio buses\n  with volume\u002Fmute and effects, music vs SFX routing, db\u002Flinear volume, and precise\n  sync-to-beat playback timing. Use when playing sounds or music in a Godot project,\n  routing AudioStreamPlayer nodes to buses, adjusting bus volume via AudioServer, or\n  syncing gameplay to the beat.\n---\n\n# Godot Audio (4.x)\n\nPlay SFX and music, route them through buses, control volume in decibels, and time\ngameplay to the beat. Targets **Godot 4.7**.\n\n## When to use\n\n- Use when playing sound effects or music, routing audio to buses (Master\u002FMusic\u002FSFX),\n  adjusting volume\u002Fmute from code, adding bus effects (reverb, compressor), positional 3D\n  audio, or syncing events to music.\n\n**When *not* to use:** engine-agnostic audio *design* (adaptive music structure, mixing\nphilosophy, ducking patterns) → `audio-design`; importing\u002Fencoding assets outside Godot.\n\n## Core workflow\n\n1. **Pick the player node:**\n   - `AudioStreamPlayer` — non-positional (music, UI, global SFX).\n   - `AudioStreamPlayer2D` \u002F `AudioStreamPlayer3D` — positional; volume\u002Fpan from distance.\n2. **Assign an `AudioStream`** to `stream` (`.ogg` for music\u002Floops, `.wav` for short SFX)\n   and `play()`. Set `autoplay` for music that starts with the scene.\n3. **Route to a bus.** Set the player's `bus` to a named bus (e.g. `\"Music\"`, `\"SFX\"`).\n   Define buses in the Audio panel (bottom dock); each can have volume, mute, solo, and\n   effects.\n4. **Control volume in dB**, not linear (audio is logarithmic). `0 dB` = unchanged,\n   `-80 dB` ≈ silent. Convert with `linear_to_db`\u002F`db_to_linear`, or use the linear helpers\n   (`volume_linear` on players, `AudioServer.set_bus_volume_linear()`), which convert for you.\n5. **Drive volume\u002Fmute from code** with `AudioServer` by bus index.\n6. **For rhythm**, compute precise playback time using output latency compensation.\n\n## Patterns\n\n### 1. One-shot SFX (fire-and-forget)\n\n```gdscript\n@onready var sfx: AudioStreamPlayer = $Sfx   # stream assigned in the editor\n\nfunc play_jump() -> void:\n    sfx.pitch_scale = randf_range(0.95, 1.05)   # slight variation avoids fatigue\n    sfx.play()\n\n# For overlapping copies, raise sfx.max_polyphony (default 1), use an\n# AudioStreamPolyphonic stream, or spawn short-lived players and free on `finished`.\n```\n\n### 2. Set a bus's volume and mute via AudioServer\n\n```gdscript\nfunc set_music_volume(linear_0_to_1: float) -> void:\n    var bus := AudioServer.get_bus_index(\"Music\")\n    # Convert a 0..1 slider to decibels; clamp avoids -inf at 0.\n    AudioServer.set_bus_volume_db(bus, linear_to_db(maxf(linear_0_to_1, 0.0001)))\n\nfunc toggle_sfx(muted: bool) -> void:\n    AudioServer.set_bus_mute(AudioServer.get_bus_index(\"SFX\"), muted)\n```\n\n### 3. Crossfade between two music tracks\n\n```gdscript\n@onready var a: AudioStreamPlayer = $MusicA\n@onready var b: AudioStreamPlayer = $MusicB\n\nfunc crossfade_to(stream: AudioStream, secs := 1.5) -> void:\n    b.stream = stream\n    b.volume_db = -40.0\n    b.play()\n    var tw := create_tween().set_parallel(true)\n    tw.tween_property(a, \"volume_db\", -40.0, secs)   # fade out current\n    tw.tween_property(b, \"volume_db\", 0.0, secs)     # fade in next\n    tw.chain().tween_callback(a.stop)\n    var tmp := a; a = b; b = tmp                      # swap roles\n```\n\n### 4. Beat-accurate timing (compensate for output latency)\n\n```gdscript\n@onready var music: AudioStreamPlayer = $Music\n\nfunc get_playback_time() -> float:\n    # Add time since the last audio mix, subtract output latency, for sub-frame accuracy.\n    var t := music.get_playback_position() + AudioServer.get_time_since_last_mix()\n    return t - AudioServer.get_output_latency()\n```\n\n## Pitfalls\n\n- **Treating volume as linear.** `volume_db`\u002F`set_bus_volume_db` are decibels. Setting\n  `volume_db = 0.5` is nearly full volume, not half. Map sliders with `linear_to_db`.\n- **`linear_to_db(0.0)` is `-inf`.** It is silent, but tweening or doing math from `-inf`\n  produces NaN. Clamp the linear value to a small minimum (e.g. `0.0001`) before converting,\n  or special-case 0 → mute. `set_bus_volume_linear(bus, 0.0)` stores `-inf` too.\n- **Bus name typos fail quietly.** `get_bus_index(\"Muisc\")` returns `-1`; calls then error\n  or no-op. Match the exact bus name from the Audio panel.\n- **Short SFX cut off** when the same player is retriggered → `max_polyphony` defaults to 1.\n  Raise it (e.g. 4) so `play()` overlaps copies, or use an `AudioStreamPolyphonic` \u002F\n  separate players freed on `finished`.\n- **Music doesn't loop** unless the import\u002Fstream loop is enabled (`.ogg` import has a\n  Loop option; `AudioStreamWAV` has `loop_mode`).\n- **Syncing to `get_playback_position()` alone is jittery** — it updates per audio mix,\n  not per frame; add `get_time_since_last_mix()` and subtract `get_output_latency()`.\n- **3D audio inaudible** → no `AudioListener3D`\u002F`Camera3D` to hear it, or `max_distance`\u002F\n  attenuation too tight, or wrong bus muted.\n\n## References\n\n- For the bus layout (`.tres`), adding effects (reverb\u002Fcompressor\u002FEQ) and side-chain\n  ducking, `AudioStreamPolyphonic`\u002F`AudioStreamInteractive`, microphone capture, and\n  procedural audio with `AudioStreamGenerator`, read `references\u002Fbuses-and-effects.md`.\n\n## Related skills\n\n- `audio-design` — engine-agnostic adaptive music, mixing, and ducking practice.\n- `godot-animation` — syncing animation\u002FTween to `get_playback_position()`.\n- `godot-ui-control` — volume sliders wired to `AudioServer`.\n","# Godot Audio (4.x)\n\nPlay SFX and music, route them through buses, control volume in decibels, and time\ngameplay to the beat. Targets **Godot 4.7**.\n\n## When to use\n\n- Use when playing sound effects or music, routing audio to buses (Master\u002FMusic\u002FSFX),\n  adjusting volume\u002Fmute from code, adding bus effects (reverb, compressor), positional 3D\n  audio, or syncing events to music.\n\n**When *not* to use:** engine-agnostic audio *design* (adaptive music structure, mixing\nphilosophy, ducking patterns) → `audio-design`; importing\u002Fencoding assets outside Godot.\n\n## Core workflow\n\n1. **Pick the player node:**\n   - `AudioStreamPlayer` — non-positional (music, UI, global SFX).\n   - `AudioStreamPlayer2D` \u002F `AudioStreamPlayer3D` — positional; volume\u002Fpan from distance.\n2. **Assign an `AudioStream`** to `stream` (`.ogg` for music\u002Floops, `.wav` for short SFX)\n   and `play()`. Set `autoplay` for music that starts with the scene.\n3. **Route to a bus.** Set the player's `bus` to a named bus (e.g. `\"Music\"`, `\"SFX\"`).\n   Define buses in the Audio panel (bottom dock); each can have volume, mute, solo, and\n   effects.\n4. **Control volume in dB**, not linear (audio is logarithmic). `0 dB` = unchanged,\n   `-80 dB` ≈ silent. Convert with `linear_to_db`\u002F`db_to_linear`, or use the linear helpers\n   (`volume_linear` on players, `AudioServer.set_bus_volume_linear()`), which convert for you.\n5. **Drive volume\u002Fmute from code** with `AudioServer` by bus index.\n6. **For rhythm**, compute precise playback time using output latency compensation.\n\n## Patterns\n\n### 1. One-shot SFX (fire-and-forget)\n\n```gdscript\n@onready var sfx: AudioStreamPlayer = $Sfx   # stream assigned in the editor\n\nfunc play_jump() -> void:\n    sfx.pitch_scale = randf_range(0.95, 1.05)   # slight variation avoids fatigue\n    sfx.play()\n\n# For overlapping copies, raise sfx.max_polyphony (default 1), use an\n# AudioStreamPolyphonic stream, or spawn short-lived players and free on `finished`.\n```\n\n### 2. Set a bus's volume and mute via AudioServer\n\n```gdscript\nfunc set_music_volume(linear_0_to_1: float) -> void:\n    var bus := AudioServer.get_bus_index(\"Music\")\n    # Convert a 0..1 slider to decibels; clamp avoids -inf at 0.\n    AudioServer.set_bus_volume_db(bus, linear_to_db(maxf(linear_0_to_1, 0.0001)))\n\nfunc toggle_sfx(muted: bool) -> void:\n    AudioServer.set_bus_mute(AudioServer.get_bus_index(\"SFX\"), muted)\n```\n\n### 3. Crossfade between two music tracks\n\n```gdscript\n@onready var a: AudioStreamPlayer = $MusicA\n@onready var b: AudioStreamPlayer = $MusicB\n\nfunc crossfade_to(stream: AudioStream, secs := 1.5) -> void:\n    b.stream = stream\n    b.volume_db = -40.0\n    b.play()\n    var tw := create_tween().set_parallel(true)\n    tw.tween_property(a, \"volume_db\", -40.0, secs)   # fade out current\n    tw.tween_property(b, \"volume_db\", 0.0, secs)     # fade in next\n    tw.chain().tween_callback(a.stop)\n    var tmp := a; a = b; b = tmp                      # swap roles\n```\n\n### 4. Beat-accurate timing (compensate for output latency)\n\n```gdscript\n@onready var music: AudioStreamPlayer = $Music\n\nfunc get_playback_time() -> float:\n    # Add time since the last audio mix, subtract output latency, for sub-frame accuracy.\n    var t := music.get_playback_position() + AudioServer.get_time_since_last_mix()\n    return t - AudioServer.get_output_latency()\n```\n\n## Pitfalls\n\n- **Treating volume as linear.** `volume_db`\u002F`set_bus_volume_db` are decibels. Setting\n  `volume_db = 0.5` is nearly full volume, not half. Map sliders with `linear_to_db`.\n- **`linear_to_db(0.0)` is `-inf`.** It is silent, but tweening or doing math from `-inf`\n  produces NaN. Clamp the linear value to a small minimum (e.g. `0.0001`) before converting,\n  or special-case 0 → mute. `set_bus_volume_linear(bus, 0.0)` stores `-inf` too.\n- **Bus name typos fail quietly.** `get_bus_index(\"Muisc\")` returns `-1`; calls then error\n  or no-op. Match the exact bus name from the Audio panel.\n- **Short SFX cut off** when the same player is retriggered → `max_polyphony` defaults to 1.\n  Raise it (e.g. 4) so `play()` overlaps copies, or use an `AudioStreamPolyphonic` \u002F\n  separate players freed on `finished`.\n- **Music doesn't loop** unless the import\u002Fstream loop is enabled (`.ogg` import has a\n  Loop option; `AudioStreamWAV` has `loop_mode`).\n- **Syncing to `get_playback_position()` alone is jittery** — it updates per audio mix,\n  not per frame; add `get_time_since_last_mix()` and subtract `get_output_latency()`.\n- **3D audio inaudible** → no `AudioListener3D`\u002F`Camera3D` to hear it, or `max_distance`\u002F\n  attenuation too tight, or wrong bus muted.\n\n## References\n\n- For the bus layout (`.tres`), adding effects (reverb\u002Fcompressor\u002FEQ) and side-chain\n  ducking, `AudioStreamPolyphonic`\u002F`AudioStreamInteractive`, microphone capture, and\n  procedural audio with `AudioStreamGenerator`, read `references\u002Fbuses-and-effects.md`.\n\n## Related skills\n\n- `audio-design` — engine-agnostic adaptive music, mixing, and ducking practice.\n- `godot-animation` — syncing animation\u002FTween to `get_playback_position()`.\n- `godot-ui-control` — volume sliders wired to `AudioServer`.\n",{"name":5,"description":7},"main","5d0a87185c0e172c3901e2a6e5916b6d544b8b94","skills\u002Fgodot-audio","https:\u002F\u002Fgithub.com\u002FJunMystery\u002FAgent-Guidance","https:\u002F\u002Fgithub.com\u002FJunMystery","AI is the typist, I am the architect. Building efficient, secure, and user-centric products through disciplined AI prompt engineering.","2026-11-13 17:41:25",{"source":8,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add JunMystery\u002FAgent-Guidance --skill godot-audio",{"tool":37,"command":38},"bunx","bunx skills add JunMystery\u002FAgent-Guidance --skill godot-audio",{"tool":40,"command":41},"pnpm","pnpm dlx skills add JunMystery\u002FAgent-Guidance --skill godot-audio","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FJunMystery\u002FAgent-Guidance\u002Fblob\u002Fmain\u002Fskills\u002Fgodot-audio\u002FSKILL.md",true,[45],{"path":46,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":49,"sourceHtmlUrl":50},"references\u002Fbuses-and-effects.md","REFERENCE","参考文档",3943,"https:\u002F\u002Fgithub.com\u002FJunMystery\u002FAgent-Guidance\u002Fblob\u002Fmain\u002Fskills\u002Fgodot-audio\u002Freferences\u002Fbuses-and-effects.md",[52,58,64,70,76,82],{"skillNo":53,"name":54,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":55,"categories":56,"keywords":57,"publishedAt":19},"01M79QR1E309VJ6CTQKB32AWWA","zero-trust-architecture-cheat-sheet","https:\u002F\u002Fgithub.com\u002FJunMystery\u002FAgent-Guidance\u002Fblob\u002Fmain\u002Fskills\u002Fzero-trust-architecture-cheat-sheet\u002FSKILL.md",[],[],{"skillNo":59,"name":60,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":19},"01M79QQV7GHYR02DYGN41S23WN","xss-filter-evasion-cheat-sheet","https:\u002F\u002Fgithub.com\u002FJunMystery\u002FAgent-Guidance\u002Fblob\u002Fmain\u002Fskills\u002Fxss-filter-evasion-cheat-sheet\u002FSKILL.md",[],[],{"skillNo":65,"name":66,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":19},"01M79QQNSN7YB8XB61FFSCS3WH","xs-leaks-cheat-sheet","https:\u002F\u002Fgithub.com\u002FJunMystery\u002FAgent-Guidance\u002Fblob\u002Fmain\u002Fskills\u002Fxs-leaks-cheat-sheet\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":19},"01M79QQHZZJKFDY9132G5A65C2","xpath-injection-prevention-cheat-sheet","https:\u002F\u002Fgithub.com\u002FJunMystery\u002FAgent-Guidance\u002Fblob\u002Fmain\u002Fskills\u002Fxpath-injection-prevention-cheat-sheet\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":19},"01M79QQB9ZSD3DJG8658EHQXR1","xml-security-cheat-sheet","https:\u002F\u002Fgithub.com\u002FJunMystery\u002FAgent-Guidance\u002Fblob\u002Fmain\u002Fskills\u002Fxml-security-cheat-sheet\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":19},"01M79QQ60WKV7PFMXWT9CW8PM6","xml-external-entity-prevention-cheat-sheet","https:\u002F\u002Fgithub.com\u002FJunMystery\u002FAgent-Guidance\u002Fblob\u002Fmain\u002Fskills\u002Fxml-external-entity-prevention-cheat-sheet\u002FSKILL.md",[],[]]