87 lines
4.2 KiB
Markdown
87 lines
4.2 KiB
Markdown
# @suaveplan/audio-ir-room-plugin-club - Original audio-ir content package: ships the bundled `club1.wav` and `club2.wav` room impulse responses, registered through @suaveplan/storage-uri-plugin-bundle and @suaveplan/audio-ir-core. Universal; bundle-only content package.
|
|
|
|
Original audio-ir content package. Ships two bundled room impulse responses (`club1.wav`, `club2.wav`) wired through the `@suaveplan/audio-ir-*` family.
|
|
|
|
This package is the canonical example of the **bundle-only** content-package pattern in the IR family — every future `audio-ir-{family}-plugin-<name>` package that ships only local files follows this shape.
|
|
|
|
<!-- begin:auto-docs -->
|
|
## Documentation tree
|
|
|
|
- [manifest](./src/manifest/manifest.md) — The `manifest` constant is the single source of truth for which impulse responses this content package ships. It is a `…
|
|
- [manifest](./src/manifest/manifest.md) — The `manifest` constant is the single source of truth for which impulse responses this content package ships. It is a `…
|
|
- [register](./src/register/register.md) — This module is the only side-effecting entrypoint a consumer ever calls from `@suaveplan/audio-ir-room-plugin-club`. It…
|
|
- [register](./src/register/register.md) — This module is the only side-effecting entrypoint a consumer ever calls from `@suaveplan/audio-ir-room-plugin-club`. It…
|
|
<!-- end:auto-docs -->
|
|
|
|
## Install
|
|
|
|
```bash
|
|
bun add @suaveplan/audio-ir-room-plugin-club
|
|
```
|
|
|
|
Peer-installed alongside `@suaveplan/audio-ir-core`, `@suaveplan/storage-uri`, `@suaveplan/storage-uri-plugin-bundle`.
|
|
|
|
## Quick start
|
|
|
|
```ts
|
|
import {
|
|
createIrRegistry,
|
|
createUriPluginCollector,
|
|
} from "@suaveplan/audio-ir-core";
|
|
import { register } from "@suaveplan/audio-ir-room-plugin-club";
|
|
import { createIrLoader } from "@suaveplan/audio-ir-loader";
|
|
import { createStorageUriResolver } from "@suaveplan/storage-uri";
|
|
import { nodeFileFetch } from "@suaveplan/storage-uri-plugin-bundle/node-fetch";
|
|
import { decodeWav } from "@suaveplan/audio-decode-wav";
|
|
|
|
const registry = createIrRegistry();
|
|
const collector = createUriPluginCollector();
|
|
register(registry, collector, { fetch: nodeFileFetch }); // omit `fetch` in the browser
|
|
const resolver = createStorageUriResolver(collector.plugins);
|
|
|
|
const loader = createIrLoader({
|
|
registry,
|
|
resolver,
|
|
decoders: { wav: decodeWav },
|
|
});
|
|
|
|
const club1 = await loader.load("club-club1");
|
|
const club2 = await loader.load("club-club2");
|
|
```
|
|
|
|
## Manifest
|
|
|
|
| `id` | URI | Channels | Sample rate | Gain |
|
|
|---|---|---|---|---|
|
|
| `club-club1` | `bundle://audio-ir-room-plugin-club/club1.wav` | 2 | 44 100 Hz | 0 dB |
|
|
| `club-club2` | `bundle://audio-ir-room-plugin-club/club2.wav` | 2 | 44 100 Hz | 0 dB |
|
|
|
|
Channels and sample rate are decoded at manifest-authoring time; the loader re-validates and throws `AUDIO_IR_LOADER.MANIFEST_MISMATCH` on disagreement.
|
|
|
|
## Modules
|
|
|
|
- `./manifest` — `manifest: IrManifest`, `BUNDLE_PACKAGE_SLUG`, `MANIFEST_SLUG`.
|
|
- `./register` — `register(registry, collector, options?)` (collector pattern).
|
|
|
|
The root barrel re-exports every public binding so `import { register } from "@suaveplan/audio-ir-room-plugin-club"` is equivalent to the subpath form.
|
|
|
|
## Browser vs Node
|
|
|
|
- **Browser**: omit `options.fetch` in `register` — `globalThis.fetch` reads the bundled URL directly.
|
|
- **Node**: pass `register(registry, collector, { fetch: nodeFileFetch })` from `@suaveplan/storage-uri-plugin-bundle/node-fetch` — Node's undici-backed global `fetch` refuses `file:` URLs.
|
|
|
|
## License & sources
|
|
|
|
This package is published under the MIT license. Both IR captures (`club1.wav`, `club2.wav`) originate from the operator's Mountain Duck media library at `/media/_/audio/ir/room/club{1,2}.wav` and are redistributed inside Suaveplan under the same MIT license. The IR samples themselves are room captures with no upstream proprietary attribution requirement.
|
|
|
|
The `IrManifestEntry.source` field on each entry records the Mountain Duck origin path so a future operator can reproduce the import end-to-end.
|
|
|
|
## Pre-publish gate
|
|
|
|
```bash
|
|
bunx turbo lint typecheck test --filter=@suaveplan/audio-ir-room-plugin-club
|
|
bunx turbo test:coverage --filter=@suaveplan/audio-ir-room-plugin-club # 100/100/100/100
|
|
bunx turbo build --filter=@suaveplan/audio-ir-room-plugin-club
|
|
```
|
|
|