Cross-platform, low-latency microphone streaming for Node.js
No ffmpeg. No SoX. No setup. Capture audio from the system microphone and pipe it anywhere: speech engines, WebSockets, or files.
Install with one command:
Then start streaming:
const Decibri = require('decibri'); const mic = new Decibri({ sampleRate: 16000, channels: 1 }); mic.on('data', (chunk) => { websocket.send(chunk); // stream audio to your backend });
Microphone input in Node.js is harder than it should be
Designed for real-time systems
A native Node.js addon wrapping PortAudio. Statically linked, zero system dependencies, with pre-built binaries so there's nothing to compile.
Cross-platform
macOS, Windows, and Linux with pre-built binaries. No build tools required on any platform.
Direct capture
100ms audio chunks by default (1600 frames at 16kHz). PortAudio captures directly from the OS audio layer with no subprocess, no shell, and no intermediate encoding.
Stream interface
Standard Node.js Readable stream. Pipe to files, WebSockets, or speech engines directly.
Zero dependencies
No ffmpeg, no SoX, no system audio libraries. PortAudio is compiled and statically linked.
TypeScript ready
Bundled type definitions. Full IntelliSense for options, events, and device enumeration.
Configurable
Sample rate, channels, frames per buffer, device selection by index or name, int16 or float32 output, and optional voice activity detection with speech/silence events.
Built for real-time voice applications
Record audio to disk
Because decibri exposes a standard Node.js Readable stream, you can pipe audio directly to a file. Set the sample rate and channels to match your target format. No encoding step, no intermediate buffers.
const Decibri = require('decibri'); const fs = require('fs'); const mic = new Decibri({ sampleRate: 44100, channels: 2 }); mic.pipe(fs.createWriteStream('capture.raw'));
Works with your existing stack
decibri outputs raw 16-bit PCM, the standard format expected by speech and audio processing engines. See the integration guides for working examples.
Sherpa-ONNX
Speech-to-text, keyword spotting, and voice activity detection, all offline
LocalWhisper.cpp
Local speech-to-text transcription with OpenAI's Whisper model
CloudDeepgram
Real-time cloud speech-to-text with Deepgram's Nova-3 model
CloudAssemblyAI
Real-time cloud speech-to-text with turn-based transcription
CloudOpenAI
Real-time cloud speech-to-text with OpenAI's Realtime API
CloudMistral
Real-time cloud speech-to-text with Voxtral open-weights model
CloudAWS Transcribe
Real-time cloud speech-to-text with Amazon Transcribe streaming
CloudReal-time cloud speech-to-text with Google Cloud Speech-to-Text
CloudAzure
Real-time cloud speech-to-text with Azure Speech-to-Text
decibri's raw PCM output is also compatible with Vosk, openWakeWord, and any engine that accepts standard audio input.
Real products, powered by decibri
Open-source tools that use decibri as their audio capture layer. From voice agents to wake phrase detection.
Voice-powered terminal agent. Speak commands, get answers. Fully offline using whisper.cpp for local transcription and Ollama for local LLM inference. No cloud, no API keys.
Voice activation for code editors. Say "Hey Claude" and Claude opens. Say "Hey Copilot" and Copilot opens. Fully local wake phrase detection using sherpa-onnx. Zero config.
These products use decibri as their audio capture layer. decibri handles the microphone. Each product adds its own processing on top.
The right tool for the job
Use decibri when you need raw PCM audio from a system microphone inside a Node.js process. For example, feeding audio to a local speech-to-text engine, a wake word detector, or a real-time WebSocket pipeline. For browser-based audio capture, see decibri-web, which provides the same API using the Web Audio API with zero dependencies.
Other approaches
micnpm package requires SoX or arecord installed on the systemmicrophone-streamis browser-only and does not work in Node.js- Shelling out to ffmpeg adds latency, process management, and a large dependency
- Most alternatives have no prebuilt binaries and require build tools on every machine
decibri
- Native PortAudio addon with no system audio tools needed
- Purpose-built for Node.js server-side and CLI use cases
- Prebuilt binaries ship in the package with zero post-install setup
- Standard Readable stream API: pipe, transform, and compose
Pre-built binaries, zero setup
Pre-compiled native binaries ship inside the package. No build tools, no compilation, no post-install downloads.
Common questions
16-bit signed integer PCM, little-endian by default. A 32-bit float format is also available. The default is the raw format expected by most speech and wake-word engines including Vosk, sherpa-onnx, and whisper.cpp.
No. decibri bundles PortAudio as a statically linked native addon. There are no system dependencies to install.
No. Pre-built binaries for Windows x64, macOS arm64, and Linux x64/arm64 ship inside the npm package. If no binary is available for your platform, it falls back to compiling from source.
The Node.js package is a native addon for server-side and CLI use only. For browser-based capture, see decibri-web, which provides the same API using the Web Audio API with zero dependencies.
Yes. Use Decibri.devices() to list available input devices, then pass the device index or a name substring to the constructor options.
Node.js 18 and above.
Apache-2.0.
Start streaming audio in minutes
One install. One import. Real-time microphone audio.