@nhtio/adk/lib/utils/audio
Environment-neutral PCM audio primitives shared across the media battery and the on-device specialist batteries.
Remarks
These are pure helpers over Float32Array — no DOM, no Node built-ins, no core class coupling. They are shared (not duplicated) by src/batteries/media (which re-exports resampleTo from its image_audio step and calls downmixToMono from its audio_decode engine) and by src/batteries/specialists/_shared (whose default audio decoder downmixes before handing PCM to a specialist model). The bundler inlines this module into each consumer, so sharing introduces no build coupling.
Functions
| Function | Description |
|---|---|
| downmixToMono | Downmixes one or more PCM channels to a single mono channel by averaging samples across channels. |
| resampleTo | Linearly resamples a mono PCM buffer from one sample rate to another. |