Skip to content
1 min read · 132 words

@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

FunctionDescription
downmixToMonoDownmixes one or more PCM channels to a single mono channel by averaging samples across channels.
resampleToLinearly resamples a mono PCM buffer from one sample rate to another.