Relocate the ~6k-file docs tree from the repo root into plugins/document-navigator/docs/ so the plugin is self-contained and portable. docs/superpowers/ (specs and plans) stays at the repo root. Moved via cp+rm rather than git mv because directory rename() fails with EPERM on this WSL /mnt DrvFs mount; git rename-detection pairs the identical-content files at commit time. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
3.9 KiB
3.9 KiB
@suaveplan/audio-sprite-packer - Binary audio sprite map packer with 80%+ compression versus individual files: pack multiple audio clips into a single concatenated binary with a compact JSON manifest.
Universal audio sprite packer with injectable adapter, Zod-validated boundaries, and OpenTelemetry instrumentation. Zero browser or Node.js dependencies.
Documentation tree
- benchmarks — This benchmark suite measures the throughput of
AudioSpritePacker.packunder varying clip counts using `NullAudioAdap…- audio-sprite-packer.bench — This benchmark suite measures the throughput of
AudioSpritePacker.packunder varying clip counts using `NullAudioAdap…
- audio-sprite-packer.bench — This benchmark suite measures the throughput of
- null-adapter —
NullAudioAdapteris a deterministic, test-only implementation of theAudioAdapterinterface. It produces predictabl…- null-adapter —
NullAudioAdapteris a deterministic, test-only implementation of theAudioAdapterinterface. It produces predictabl…
- null-adapter —
- audio-sprite-packer —
AudioSpritePackeris the primary orchestrator for combining multiple audio clips into a single concatenated buffer wi…- audio-sprite-packer —
AudioSpritePackeris the primary orchestrator for combining multiple audio clips into a single concatenated buffer wi…
- audio-sprite-packer —
- error-codes — This module centralises every error code, metadata description, and severity level that the `@suaveplan/audio-sprite-pa…
- error-codes — This module centralises every error code, metadata description, and severity level that the `@suaveplan/audio-sprite-pa…
- types — This module defines the public-facing TypeScript interfaces, Zod boundary schemas, and runtime types shared across the…
- common — This module defines the public-facing TypeScript interfaces, Zod boundary schemas, and runtime types shared across the…
- manifest — This module assembles and validates
AudioSpriteManifestobjects.buildManifestcreates a manifest from packed entri…- manifest — This module assembles and validates
AudioSpriteManifestobjects.buildManifestcreates a manifest from packed entri…
- manifest — This module assembles and validates
Install
bun add @suaveplan/audio-sprite-packer
Quick start
import { AudioSpritePacker, NullAudioAdapter } from "@suaveplan/audio-sprite-packer";
const packer = new AudioSpritePacker({ adapter: new NullAudioAdapter() });
const sprite = await packer.pack([
{ name: "jump", data: jumpBytes },
{ name: "land", data: landBytes },
{ name: "coin", data: coinBytes },
]);
// Retrieve individual clips by name.
const jump = packer.unpack(sprite, "jump");
console.log(jump.length); // encoded byte length
Modules
src/core/audio-sprite-packer/audio-sprite-packer.md—AudioSpritePackerclass andcreateAudioSpritePackerfactorysrc/utils/manifest/manifest.md—buildManifestandvalidateManifestsrc/adapters/null-adapter/null-adapter.md—NullAudioAdapterfor testingsrc/types/common.md—AudioAdapterinterface, Zod schemas, and public typessrc/error-codes.md— Error codes andAudioSpriteErrorclasssrc/__benchmarks__/audio-sprite-packer.bench.md— Benchmark suite notes