// the find
TooTallNate/node-speaker
Output PCM audio data to the speakers
node-speaker wraps mpg123's audio output modules to expose a Node.js Writable stream that plays raw PCM data through system speakers. It's the missing piece when you've already decoded audio in Node and just need to hear it — no separate audio daemon required.
The Writable stream interface is the right abstraction here: you can pipe decoded PCM from any source directly into the speaker with no glue code. Backend coverage is solid — ALSA, CoreAudio, WinMM, and a dozen more are all handled by the bundled mpg123, so you don't need to install a system audio library separately on most platforms. The `device` option lets you target a specific ALSA card by name, which matters for headless or multi-output setups. The bundled mpg123 vendored under `deps/` means the build is self-contained and won't break when a system package gets upgraded.
The native addon (node-gyp) makes this painful in CI and serverless environments — you're compiling C on install, and if the toolchain isn't there it just fails. The bundled mpg123 is old enough that the vendored assembly files cover 3DNow! and i486 but the build machinery hasn't been touched in years, which causes occasional breakage on newer Node ABI versions without a rebuild. There's no backpressure handling documented anywhere, so if you pipe faster than the audio backend can drain you'll get buffer overruns with no useful error. The TypeScript definitions in `index.d.ts` are minimal — events (`open`, `flush`, `close`) aren't typed at all.