SkillsGrove
SkillsGrove/動画制作/Kevin-Liu-01/Claude-of-Tanks/src-audio-skill

src-audio-skill

インストール

$npx skills add https://github.com/Kevin-Liu-01/Claude-of-Tanks --skill src-audio-skill
$git clone --depth 1 https://github.com/Kevin-Liu-01/Claude-of-Tanks.git /tmp/Claude-of-Tanks && mkdir -p ~/.claude/skills && cp -r /tmp/Claude-of-Tanks/src/audio ~/.claude/skills/src-audio-skill
この Agent Skill をインストールしてください:https://github.com/Kevin-Liu-01/Claude-of-Tanks/tree/b6c100411f0a2ec788bde350b9b73665a4c5d8ec/src/audio — まず SKILL.md とスクリプトを読み、安全であることを確認してから、私のスキルフォルダにインストールしてください。

概要

原文の説明 · MITWork on event-driven spatial audio, radio voices, engines, weapons, ambience, and mix state.
以下の SKILL.md は Kevin-Liu-01/Claude-of-Tanks(コミット b6c1004)から MIT ライセンスに基づいて転載しています。本文は変更しておらず、ファイル先頭のメタデータのみ省略し、画像はリンクとして表示し、非常に長いファイルは途中までの表示としています。Copyright 2026 Kevin B. Liu。ライセンス:LICENSE。表示しているのは指示ファイルのみです。スクリプト等は元のリポジトリをご覧ください。

claude-of-tanks / src/audio

Purpose

<!-- agent-docs:fill:purpose -->

Translate canonical game-bus events and listener state into responsive spatial audio without owning gameplay decisions.

Mental model & key files

<!-- agent-docs:fill:model -->

For generating or repairing sounds and crew lines, follow the audio-generation skill and its prompt cookbook. Start from docs/AUDIO.md: the runtime design, the generation pipeline (SFX and crew voices) and how to change or extend it. audioEngine.ts owns the bus subscriptions, listener frame, vehicle rigs, weapons, impacts, ambience, alarms and the window.__COT_AUDIO debug surface. Pure, DOM-free policy: audioMath.ts (distance, air absorption, delay, Doppler, atmospheres, pan), mixPolicy.ts (levels, snapshots, HDR, budgets, LOD), soundCues.ts (per-asset bus/space/jitter/caps), weaponAudio.ts (report classes, reload choreography, and ROAR/SUSTAIN_BODY: how a fast gun's burst is voiced by its fire-rate regime, fireRegime in src/game/shotCadence.ts, held by the engine's burstRound), toggleSettle.ts (a toggle's sound settles on its final state), vehicleAudioProfiles.ts + vehicleAudioModel.ts (powertrain identity, RPM/gear/track model), environmentScenes.ts (per-map scenes, bells, flyovers by era, SPOT_HOURS and each scene's night life), propSounds.ts (what every world prop kind sounds like), modeSounds.ts (every mode's opener and every mode_* event's sounds, exhaustive; worldSounds.selftest.mjs scans the controller), voiceLines.ts (radio discipline, and resolveCrewLine: each mode's and the AC-130 crew's own call for a tank crew's line, from the exhaustive MODE_CREW and GUNSHIP_CREW), crewProcedure.ts (the crew's procedure on moments the sound handlers leave unvoiced: the fire command and its answers, APS/ERA, the drone's flight, the modes' own moments, the gunship's fire control; its state is two declared scopes, the battle's, started by the engine's resetBattlePlay, and our tank's life's, started by the engine's startOwnLife at each revive of our hull and each seat the player takes, as it notices them). Web Audio owners: mixer.ts, assetLibrary.ts, voicePool.ts, vehicleRig.ts, ambienceDirector.ts, crewRadio.ts. captions.ts owns the caption stream (BUI-F9): every keyed transmission (crewRadio.ts onTransmit, with the take spoken and the speaking role from captionSpeakers.generated.ts) and the CAPTION_SOUNDS cues the engine raises (caption('id', x, y, z), with a bearing from the listener) go out on the bus as audio:caption; the renderer reads text from captionScript.generated.ts (both tables from tools/audio/build-captions.mjs, run after any crew-line edit). lazyAudio.ts owns gesture-time context creation and mixer transfer (it makes no sound of its own; the mixer's chunk is an app/lazyChunk.ts chunk, asked again after a failure under its backoff, never per gesture or offline) and the device's lifecycle (an interrupted or suspended context re-arms the gesture unlock; a muted or silent game's gesture keeps it, and unmuting resumes a stopped device); listenerPoseRuntime.ts owns the hybrid camera/vehicle listener. battleMode.ts declares the engine's battle mode (garage, loading, live, over, presented, with the pause and kill-cam overlays) and its one transition, stepAudioBattleMode, shared by the engine and the facade: build a new battle fact with audioBattleFact (one reading of a payload for both layers), route it through the transition (which refuses an overlay move that changes nothing or comes outside a battle), and take it ungated (it is state, not a cue). The kill-cam overlay's fact is the replay's own flag (src/game/killcamScreen.ts, killcam.ts active), read at each edge and by the engine every frame, never the edge itself. A field the engine resets has one of three owners: the phase edge (modeEdge: the ambience intent and the reload call), the battle world's teardown (teardownBattle: loops, the alarm, the heartbeat, the listener, burning), and the new battle (resetBattleFields(): every other per-battle field) (2026-11-02 audit F11). The crew's procedure hangs off the same edges (round 8 Y3): its battle starts in resetBattlePlay (a battle edge, a network restart), its life at each revive of our hull (startOwnLife: the respawn event, or with none the frame that shows our hull standing again after its death) and at each seat the player takes in a watched battle (the frame's isPlayer on another hull, or back on one its brain drove: no revive, no event), so nothing a dead crew's rounds arm is said in the next life; a seat taken keeps its hull's radio set and fire alarm as the frame shows them, and a revive starts the set whole and the fire out, a living hull's revive (a kick-off, the range reset) included: no tank:fire follows a revive, so the respawn event stops our alarm and the hull's engine-deck fire (a network restart, every hull's). A seat its brain drives makes none of the crew's per-life or sighting calls (live() reads the frame's isPlayer); the battle's mode calls (onMode, gated on inBattle()) are the side's news and still play there, as the engine's own do. The pause menu silences the net (the line on the air and the queue go as it opens, each edge cancels the crew's armed calls, a recalled drone's recovery included, say() refuses 'paused', no radio or crew frame runs behind the menu, a network battle's included). Our drone is read as the authority flies it: its feed live while active, a recall accepted as returnS (the flight home, "recovered" once it is parked), never recallS (the recall's gate at launch). It names only what the player sees: src/game/playerVisibility.ts is the one rule (the network's word, the watch and couch reveals, our side, the seat's own spot), handed to audio.update by listenerPoseRuntime.ts and stamped per frame on each indexed hull; with no rule handed in (a tool, a receipt) no hull is seen. A dead crew says only the battle's result call (isResultLine: the resolved line's group, every mode's own result call too); the mode's own ending reason names the ending before the battle's. The reload mirror's cycle is the reloading mount's: another mount selected mid-cycle is that mount's cycle joined where it stands, never a burst of its passed cues. A wanted loop whose recording failed waits, and the engine's update asks again once the library's retry is due. The two *.generated.ts manifests are written by tools/audio/build-sfx.mjs and tools/audio/build-voices.mjs.

Patterns to follow / invariants

<!-- agent-docs:fill:patterns -->

Initialize only after a user gesture, subscribe through the injected bus, play through the pool (caps, cooldowns, priority) and stop stale sounds on phase or entity teardown. Every asset id the engine names must exist in the SFX manifest (soundAssets.selftest.mjs scans play('…') calls). New sounds come from the offline pipeline (tools/audio/sfx-catalog.mjs → generate-sfx.mjs → build-sfx.mjs → loudness-receipt.mjs --ids …, which records the shipped files for sfxLoudness.selftest.mjs), never hand-dropped files; a new world prop kind gets its entry in propSounds.ts (propSounds.selftest.mjs fails on a kind it does not name); voice lines from crew-lines.json → build-voices.mjs. Never synthesize a sound or add a fallback: every cue is a recorded asset, one still decoding stays silent (soundAssets.selftest.mjs rejects any createOscillator), no cue is chained in when another fails (if (!play(a)) play(b)) and no crew speaks another's take (voiceTriggers.selftest.mjs rejects both). A new crew line needs its game moment in that matrix, and a sound a moment depends on is pinned in the battle set rather than covered. The ElevenLabs key is read from ELEVENLABS_API_KEY or ELEVENLABS_API_KEY_FILE and never written to the repo.

Common tasks → first action

<!-- agent-docs:fill:tasks -->

Trace the originating bus event, verify payload semantics, then extend the engine handler and its audioEngine.selftest.mjs scene. Use the pure selftests for policy, tools/audio-mix-balance.mjs for what a player hears (garage tone, gunfire over the battle bed, radio level, live density), tools/sfx-smoke.mjs for assets/calibres/distance, tools/voice-smoke.mjs for the crews, tools/audio-spatial-killcam-probe.mjs for listener/distance PCM and tools/audio-probe.mjs for the canonical event and bus matrix.

Gotchas

<!-- agent-docs:fill:gotchas -->

Camera direction and occupied-tank position form a hybrid listener; screen-right is forward × up (a three.js camera looking along +Z has world −X on its right). Network events may arrive late or duplicated, so presentation must key/dedupe them (the engine latches a death per life and a presentation per battle). A looping cue the engine wants goes through loopRig (it starts once its recording decodes); a pin names its owner group (library.pin(ids, replace, group), group a required PinGroup: 'session', 'battle', 'scene', 'rigs', 'aerial', 'own-weapons'; our own hull's banks replace their set at each gun change and go with the battle's teardown). Scope is an interior/headset perspective, never a mute. Keep the occupied rig regardless of distance, rank remote rigs by proximity under the LOD budget, and tear all world loops down when leaving battle. Node selftests run under type stripping: no enums or parameter properties in these modules. The countdown is live audio (only weapons wait for the rollout): a sound heard from its first frame belongs in the battle warm's presence set (presenceAssets, decoded first in the library's front lane), never at the back of the bulk; countdownAudio.selftest.mjs checks the decode order and the once-a-battle edges, and presenceFamilies.selftest.mjs that every vehicle warms the bank its rig plays (resolve a hull from its whole spec, getVehicleSpec, never its id alone). A network seat's tank list is what its team spots: never count a side from it (the crew's side counts read getTeamRoster, the roster with the authority's deaths, where a death is final).

ライセンス全文を見る(MIT)
MIT License

Copyright (c) 2026 Kevin B. Liu

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
NOTICE を見る
# Claude of Tanks — authorship notice

Claude of Tanks was created, designed, and directed by **Kevin B. Liu**.
Claude and Codex were development tools; they are not authors, creators, or
copyright holders of the project's first-party work.

Unless a file, embedded notice, or [`docs/ATTRIBUTION.md`](docs/ATTRIBUTION.md)
identifies another author or license, every original file and asset in this
repository is Copyright © 2026 Kevin B. Liu.

The repository is MIT-licensed by default, with the exceptions defined in
[`LICENSE-POLICY.md`](LICENSE-POLICY.md):

- first-party material is licensed under the root MIT License unless it is
  identified as Reserved Content;
- procedural vehicle and battlefield source, fleet and map data, generated
  game assets, authored media and capture recipes, and first-party brand
  content are Reserved Content under the proprietary content license; and
- third-party material retains its original license and ownership.

The path-level map in `LICENSE-POLICY.md` determines which first-party license applies.
An individual file does not need to repeat this notice for that map to apply.
Files that this repository's own tools generate — renders, screenshots, video,
map plates, collision manifests, ledgers, receipts and other derived data — are
original first-party files under this notice, as are the masters they come from.

Every selectable vehicle model is original procedural geometry authored for
this project by Kevin B. Liu. External vehicle models are comparison or
research inputs only; they are not playable geometry and retain their original
authors and licenses.

Third-party fonts, marks, shader code, reference models, environment props,
and other exceptions remain the property of their respective authors. The UI
typefaces are Chakra Petch (Cadson Demak) and IBM Plex Sans and IBM Plex Mono
(IBM Corp., Reserved Font Name "Plex"), each under the SIL Open Font License
1.1 with its license file beside it in `public/fonts/<face>/OFL.txt`;
Cot Symbols, the marks face Kevin B. Liu drew from Chakra Petch's outlines,
ships under the same license in `public/fonts/cot-symbols/`, and Cot Accents,
the accented letters Kevin B. Liu assembled from IBM Plex Sans's own glyphs
under its own name, in `public/fonts/cot-accents/`; Glacis, Kevin Liu's
block face for the markings painted on the tanks, ships under the same license
as its outline module `src/ui/glacis.js` (license in `public/fonts/glacis/`); the
retired ABC Monument Grotesk (Dinamo Typefaces) is no longer in the tree. Their
required notices and exact paths are preserved in
[`docs/ATTRIBUTION.md`](docs/ATTRIBUTION.md) and `docs/licenses/`. The project
licenses do not replace or relicense those works.

Public revisions up to and including commit
`8f3dd548c1e78242f73d37c6b37797c7f9cdcb22` were published under MIT. Those
historical grants remain valid; the current policy governs the revision in
which it first appears and subsequent work.