$ show audiojs/audio
A comprehensive, isomorphic JavaScript audio processing library engineered for editing, analysis, playback, and encoding. It is non-destructive and stream-first, utilizing a paged in-memory architecture with optional OPFS caching and a Web Worker facade for off-main-thread execution. The library exposes a declarative operation (op) and statistics (stat) plugin system, enabling custom DSP atoms to be composed into serializable edit plans with undo/redo support. It includes a CLI for batch processing and a hand-rolled MCP server for AI-agent integration, plus a polished web demo and workshop pages. The codebase spans core engine modules, 50+ built-in operations (gain, fade, filters, reverb, pitch, stretch, loudness normalization, denoising, etc.), and a large ecosystem of @audio/* dependencies for codecs and advanced effects. It is tested across browser (Playwright) and Node, with benchmark comparisons against SoX, FFmpeg, librosa, and Pedalboard. While the architecture is sophisticated and well-documented, the repository exhibits some over-engineering, a very large test suite that is brittle, and identified production defects (e.g., loudness normalization clipping) that undermine its polish.
The LLM identified 4 files worth highlighting for reuse:
Implements ITU-R BS.1770-4 integrated LUFS normalization with multiple target presets (Spotify, Apple Podcasts, EBU R128) and a sample-accurate true-peak limiter using 4x Lanczos interpolation. This is a self-contained, production-grade audio processing algorithm that can be extracted for any loudness normalization task, demonstrating deep signal-processing expertise.
Provides time-stretching and pitch-shifting via a phase-locked vocoder (Laroche & Dolson 1999) with fractional hop adjustment for drift-free correction. It is a well-isolated DSP component that could be reused in other audio tools or DAWs, showcasing advanced spectral processing techniques.
The core engine defining the audio factory, plugin registration (audio.use/op/stat), page-based PCM storage, streaming read/write, and efficient block-level processing. While it is a large module, its plugin registration and page-cache abstraction are cleanly designed and could inform embedding a similar architecture in other media-processing libraries.
Implements an LRU page cache that evicts to the browser's OPFS (origin-private file system) with budget detection via navigator.storage.estimate(). This is a reusable pattern for any web application needing large binary data caching with persistent overflow, demonstrating thoughtful memory management.