Skip to main content

Decibri

Cross-platform audio capture, playback, and processing for Python.

PyPI version Python versions License

Decibri is a native Python package that delivers microphone capture, speaker output, local voice activity detection, device enumeration, and sample format conversion. It is written in Rust (via PyO3 / abi3) and ships pre-built wheels for Linux, macOS Apple Silicon, and Windows.

Install

Recommended with uv:

uv pip install decibri

Or with pip:

pip install decibri

Quickstart

Capture audio

import decibri

with decibri.Microphone(sample_rate=16000, channels=1) as mic:
    for chunk in mic:
        print(f"Got {len(chunk)} bytes")
        break  # exit after first chunk for demo

Record one second to a WAV file

import decibri

decibri.record_to_file("output.wav", duration_seconds=1.0, sample_rate=16000)

Condition and analyze a recording

import decibri

# The same conditioning chain as the live microphone, over a WAV file.
with decibri.File("clip.wav", denoise="fastenhancer-t", highpass=80) as file:
    for chunk in file:
        handle(chunk)          # conditioned int16 PCM bytes

# Whole-file speech analysis (a live stream cannot do this).
report = decibri.File("clip.wav", vad="silero").analyze()
for segment in report.segments:
    print(segment.start, segment.end)   # seconds of file time

Capture with Silero VAD

import decibri

with decibri.Microphone(sample_rate=16000, vad="silero") as mic:
    for chunk in mic:
        print(f"Got {len(chunk)} bytes; VAD score {mic.vad_score}; speaking={mic.is_speaking}")
        break  # exit after first chunk for demo

Async capture

import asyncio
import decibri

async def main():
    async with await decibri.AsyncMicrophone.open(sample_rate=16000, vad="silero") as mic:
        async for chunk in mic:
            print(f"Got {len(chunk)} bytes; VAD score {mic.vad_score}")
            break  # exit after first chunk for demo

asyncio.run(main())

Speaker output

import decibri

with decibri.Speaker(sample_rate=24000, channels=1) as spk:
    audio_bytes = b"\x00\x00" * 24000  # 1 second of silence at 24kHz int16
    spk.write(audio_bytes)  # int16 PCM
    spk.drain()

Public API

Core classes

  • Microphone: synchronous audio capture
  • Speaker: synchronous audio output
  • File: offline source; conditions a recording or in-memory samples and analyzes it for speech
  • AsyncMicrophone: async-await audio capture
  • AsyncSpeaker: async-await audio output
  • AsyncFile: async-await offline source

Module-level functions

  • decibri.input_devices(): enumerate available input devices
  • decibri.output_devices(): enumerate available output devices
  • decibri.version(): version + audio backend info
  • decibri.record_to_file(path, duration_seconds, ...): record N seconds to a WAV file
  • decibri.async_record_to_file(path, duration_seconds, ...): async equivalent

Value types

MicrophoneInfo, SpeakerInfo, VersionInfo, Chunk, VadReport, VadWindow, Segment.

Exceptions

The full hierarchy lives at decibri.exceptions. Top-level catch-targets surfaced at the package root:

  • DecibriError: base of the hierarchy
  • DeviceError: input / output device problems
  • OrtError: ONNX Runtime issues
  • OrtPathError: ORT dylib path resolution issues
  • ForkAfterOrtInit: Linux fork-after-ORT-init detection

Voice Activity Detection

Decibri ships with two VAD modes: a lightweight RMS energy threshold (opt-in via vad="energy") and a Silero ONNX model (~2.3 MB, bundled in the wheel; no API keys required). Pass the mode as the vad="silero" / vad="energy" shorthand (which uses the default threshold and a 300 ms holdoff) or as a decibri.Vad(model=, threshold=, holdoff_ms=) config object to tune them.

# Energy mode (lightweight, no model)
mic = decibri.Microphone(vad=decibri.Vad(model="energy", threshold=0.01))

# Silero mode (ML-based, more accurate in noisy environments)
mic = decibri.Microphone(vad=decibri.Vad(model="silero", threshold=0.5))

Use mic.vad_score (a value in [0, 1]) to gate downstream processing. mic.is_speaking returns the boolean above-threshold view.

Decibri ACE (audio conditioning)

Decibri ACE (Audio Conditioning Engine) is decibri's opt-in audio front-end for speech: a conditioning chain applied to the captured audio before it is delivered. Every stage is off by default, runs on-device, and needs no API key. Leave the options unset and the capture path is unchanged.

The stages run in this order. Pass any subset on the Microphone constructor:

Stage Keyword Value
DC removal dc_removal=True bool, default False
Denoise denoise="fastenhancer-t" the one bundled model
High-pass highpass=80 or 100 Hz, second-order Butterworth
AGC agc=-18 int dBFS, -40 to -3
Limiter limiter=-1.0 float dBFS, -3.0 to 0.0
import decibri

with decibri.Microphone(
    sample_rate=16000,
    denoise="fastenhancer-t",  # bundled speech-enhancement model
    highpass=80,               # remove low-frequency rumble
    agc=-18,                   # target level in dBFS
    limiter=-1.0,              # peak ceiling in dBFS
    vad=decibri.Vad(model="silero", threshold=0.5),
) as mic:
    for chunk in mic:
        if mic.is_speaking:
            handle(chunk)      # conditioned int16 PCM bytes

The denoise model is bundled in the wheel (the same way the Silero VAD model is), so denoise="fastenhancer-t" needs no download. VAD reads the signal before the chain, so mic.vad_score and mic.is_speaking are unaffected by which conditioning stages you enable. The same options are available on AsyncMicrophone.

Files

Everything a Microphone does to live audio, File does to audio you already have: the same conditioning options (dc_removal, denoise, highpass, agc, limiter), the same iteration, the same conditioned chunks out, and the same opt-in vad=. A File reads WAV, AIFF, AIFF-C and FLAC (File("clip.wav"), or the identical File.open("clip.wav"); the container is identified from the file's own bytes rather than its extension) or wraps in-memory samples (File.buffer(samples, input_rate=48000); raw samples carry no header, so their native rate is explicit). sample_rate stays the target output rate, the same meaning it has on Microphone, so a 44.1 kHz recording comes out at 16 kHz unless you set it.

Because a File is a complete recording, it can analyze the whole recording for speech:

report = decibri.File("clip.wav", vad="silero").analyze()   # or .analyse()
for w in report.scores:
    print(w.start, w.end, w.vad_score, w.is_speech)   # per 32 ms window
for segment in report.segments:
    print(segment.start, segment.end)                 # merged speech regions

analyze() requires VAD: a File built without vad= raises VadNotConfigured rather than constructing a detector silently. With vad= set, metadata iteration (iter_with_metadata()) carries per-chunk vad_score and is_speaking exactly as the microphone does, with one deliberate difference: on a File, the speaking holdoff and the Chunk.timestamp are measured in FILE time (sample positions in seconds), never wall-clock time, so a file processed faster than real time still reports correct speech timing. Iteration and analysis are separate single passes; construct one File per operation. AsyncFile mirrors the whole surface with async semantics.

Compatibility

Python Platforms
3.10, 3.11, 3.12, 3.13, 3.14 Linux x64, Linux ARM64, macOS Apple Silicon, Windows x64, Windows ARM64

On Windows ARM64 the oldest supported Python is 3.11, the first CPython release published for that platform.

Bundled assets

The wheel includes:

  • Silero VAD ONNX model (~2.3 MB): no downloads or API keys required for vad="silero".
  • ONNX Runtime dylib (~15-20 MB platform-specific): no system dependency on pip install onnxruntime.

First ORT load on vad="silero" initialization is ~100 to 500 ms (amortized across subsequent calls).

ONNX Runtime telemetry

vad="silero" and the ACE denoise stage run on ONNX Runtime, which carries its own telemetry, separate from anything decibri does. Decibri disables it on the environment it commits when it initializes the runtime. Set DECIBRI_ORT_TELEMETRY=1 in the environment before first use to leave it enabled; every other value, an empty value, and an absent variable leave it disabled.

Two limits apply on Windows and decibri can close neither, so decibri does not claim that no telemetry is emitted. ONNX Runtime logs one process-information event while the environment is being created, before the setting is applied, and logs it once per process, so that event is emitted whichever way the setting is left. The runtime also assigns its telemetry state from the Windows tracing session through an ETW callback, so the platform can re-enable telemetry after decibri has disabled it. On other platforms ONNX Runtime's telemetry provider does nothing.

Async usage

For Silero VAD in async code, use the open() factory to dispatch the synchronous ORT init off the event loop:

async with await decibri.AsyncMicrophone.open(vad="silero") as mic:
    async for chunk in mic:
        ...

Synchronous constructors (AsyncMicrophone(...)) remain supported and unchanged; open() is the recommended pattern when ORT load cost matters.

Multiprocessing

Linux multiprocessing with Silero VAD requires set_start_method('spawn'). Calling fork() after ORT initialization raises ForkAfterOrtInit:

import multiprocessing as mp

mp.set_start_method('spawn')  # required on Linux for Silero

See the ecosystem guides under bindings/python/docs/ecosystem/ (jupyter, docker, multiprocessing) for environment-specific details.

Documentation

License

Apache-2.0. See LICENSE for details.

Copyright (c) 2026 Decibri.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

decibri-0.12.0.tar.gz (2.7 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

decibri-0.12.0-cp310-abi3-win_arm64.whl (8.9 MB view details)

Uploaded CPython 3.10+Windows ARM64

decibri-0.12.0-cp310-abi3-win_amd64.whl (9.0 MB view details)

Uploaded CPython 3.10+Windows x86-64

decibri-0.12.0-cp310-abi3-manylinux_2_28_x86_64.whl (3.5 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.28+ x86-64

decibri-0.12.0-cp310-abi3-manylinux_2_28_aarch64.whl (3.4 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.28+ ARM64

decibri-0.12.0-cp310-abi3-macosx_14_0_arm64.whl (13.8 MB view details)

Uploaded CPython 3.10+macOS 14.0+ ARM64

File details

Details for the file decibri-0.12.0.tar.gz.

File metadata

  • Download URL: decibri-0.12.0.tar.gz
  • Upload date:
  • Size: 2.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for decibri-0.12.0.tar.gz
Algorithm Hash digest
SHA256 3e06bc302a7e377f488fff43750e115c2f0b5cf51d04142b18d3d6453941e4a9
MD5 ba48d82013ff091bc0ad720b68b24bc0
BLAKE2b-256 c23ccfe11452ba750b36e8124b24f2228c44ce513e71236d08a5cb97dfa2dabb

See more details on using hashes here.

Provenance

The following attestation bundles were made for decibri-0.12.0.tar.gz:

Publisher: publish-pypi.yml on decibri/decibri

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file decibri-0.12.0-cp310-abi3-win_arm64.whl.

File metadata

  • Download URL: decibri-0.12.0-cp310-abi3-win_arm64.whl
  • Upload date:
  • Size: 8.9 MB
  • Tags: CPython 3.10+, Windows ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for decibri-0.12.0-cp310-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 83cd16005bf9d8e6dacdfc355596fc427f17a2fd57c55bd224cf213ef3550d33
MD5 52c9d7f1b4242e396eb50fd828b96d17
BLAKE2b-256 e72d6839f5f9e6598f78372c901febf5579aa8102110df66b77b83e1b39bc71a

See more details on using hashes here.

Provenance

The following attestation bundles were made for decibri-0.12.0-cp310-abi3-win_arm64.whl:

Publisher: publish-pypi.yml on decibri/decibri

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file decibri-0.12.0-cp310-abi3-win_amd64.whl.

File metadata

  • Download URL: decibri-0.12.0-cp310-abi3-win_amd64.whl
  • Upload date:
  • Size: 9.0 MB
  • Tags: CPython 3.10+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for decibri-0.12.0-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 5f515b4eb9df347a7ac6505712e8dd9ff5c93d45da8a22b512059e205b1626d3
MD5 892d76600e464eb56e98d19babf12556
BLAKE2b-256 5c5ac9b18d62a13c8721cd17bba08b41f7f199e5ca95b59ba7582dd3fa0a6998

See more details on using hashes here.

Provenance

The following attestation bundles were made for decibri-0.12.0-cp310-abi3-win_amd64.whl:

Publisher: publish-pypi.yml on decibri/decibri

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file decibri-0.12.0-cp310-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for decibri-0.12.0-cp310-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 fcb40c15e897bccb0b035b52f49ae4874965ff6e26a6d9e1855d341e0c8dc4fb
MD5 5ccb44feb54a5f5a7e8df9e15da07357
BLAKE2b-256 144ae2a27ffac52f5b4397e099de13f606c0ad0ad9f69519bbb081e3a98693c5

See more details on using hashes here.

Provenance

The following attestation bundles were made for decibri-0.12.0-cp310-abi3-manylinux_2_28_x86_64.whl:

Publisher: publish-pypi.yml on decibri/decibri

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file decibri-0.12.0-cp310-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for decibri-0.12.0-cp310-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 1f865d2ca06faaa5ee5be4c1929325f3cbfb7476411af96b602f8146768e6b2e
MD5 7188b99fb2ba7e36da974302576ccaa9
BLAKE2b-256 ac1abe8587c27771829c6f5dc2093d072337a50ffcc15d252b02e09507e9be87

See more details on using hashes here.

Provenance

The following attestation bundles were made for decibri-0.12.0-cp310-abi3-manylinux_2_28_aarch64.whl:

Publisher: publish-pypi.yml on decibri/decibri

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file decibri-0.12.0-cp310-abi3-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for decibri-0.12.0-cp310-abi3-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 b4db57811ff45ab94e35f37462291114254478290414d31163cb6327c4cd554f
MD5 c0efe3d2ac1f323940ba382bf0fab38d
BLAKE2b-256 f28a64a977bd9cec70c43d7d20b58ff64b6ad8023f638fef973ef57ac897bfef

See more details on using hashes here.

Provenance

The following attestation bundles were made for decibri-0.12.0-cp310-abi3-macosx_14_0_arm64.whl:

Publisher: publish-pypi.yml on decibri/decibri

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.12.0 This release

6 files

0.11.0

5 files

0.10.0

5 files

0.9.0

5 files

0.8.0

5 files

0.7.5

5 files

0.7.4

5 files

0.7.3

5 files

0.7.2

5 files

0.7.1

5 files

0.7.0

5 files

0.6.0

5 files

0.5.0

5 files

0.4.3

5 files

0.4.2

5 files

0.4.1

5 files

0.4.0

5 files

0.3.0

5 files

0.2.1

5 files

0.2.0

5 files

0.1.3

5 files

0.1.2

4 files

0.1.1

4 files

0.1.0

4 files

0.0.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page