Cross-platform audio capture, playback, and voice activity detection
Project description
Decibri
Cross-platform audio capture, playback, and processing for Python.
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)
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 captureSpeaker: synchronous audio outputAsyncMicrophone: async-await audio captureAsyncSpeaker: async-await audio output
Module-level functions
decibri.input_devices(): enumerate available input devicesdecibri.output_devices(): enumerate available output devicesdecibri.version(): version + audio backend infodecibri.record_to_file(path, duration_seconds, ...): record N seconds to a WAV filedecibri.async_record_to_file(path, duration_seconds, ...): async equivalent
Value types
MicrophoneInfo, SpeakerInfo, VersionInfo, Chunk.
Exceptions
The full hierarchy lives at decibri.exceptions. Top-level catch-targets surfaced at the package root:
DecibriError: base of the hierarchyDeviceError: input / output device problemsOrtError: ONNX Runtime issuesOrtPathError: ORT dylib path resolution issuesForkAfterOrtInit: 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).
# Energy mode (lightweight, no model)
mic = decibri.Microphone(vad="energy", vad_threshold=0.01)
# Silero mode (ML-based, more accurate in noisy environments)
mic = decibri.Microphone(vad="silero", vad_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.
Compatibility
| Python | Platforms |
|---|---|
| 3.10, 3.11, 3.12, 3.13, 3.14 | Linux x64, Linux ARM64, macOS Apple Silicon, Windows x64 |
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).
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
- Source code & issues: github.com/decibri/decibri
- CHANGELOG: CHANGELOG.md
- Ecosystem guides (Jupyter, Docker, multiprocessing): under
bindings/python/docs/ecosystem/in the repo
License
Apache-2.0. See LICENSE for details.
Copyright (c) 2026 Decibri.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file decibri-0.2.0.tar.gz.
File metadata
- Download URL: decibri-0.2.0.tar.gz
- Upload date:
- Size: 2.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
af966e24143e102c07e425db81081ec5f857311b0f5d44b217654f11473b9a2d
|
|
| MD5 |
f1ebd475dd7aeec45ae20fa54d17490f
|
|
| BLAKE2b-256 |
a8dad7d6565bb58e59d85f3512d26cc5c03a4241a6c5db483bb213de859f54e0
|
Provenance
The following attestation bundles were made for decibri-0.2.0.tar.gz:
Publisher:
publish-pypi.yml on decibri/decibri
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
decibri-0.2.0.tar.gz -
Subject digest:
af966e24143e102c07e425db81081ec5f857311b0f5d44b217654f11473b9a2d - Sigstore transparency entry: 1674025989
- Sigstore integration time:
-
Permalink:
decibri/decibri@007618ec7e71707186e079eb706758b9b06ac4ee -
Branch / Tag:
refs/tags/python-v0.2.0 - Owner: https://github.com/decibri
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@007618ec7e71707186e079eb706758b9b06ac4ee -
Trigger Event:
push
-
Statement type:
File details
Details for the file decibri-0.2.0-cp310-abi3-win_amd64.whl.
File metadata
- Download URL: decibri-0.2.0-cp310-abi3-win_amd64.whl
- Upload date:
- Size: 8.1 MB
- Tags: CPython 3.10+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
892f40c09cca734ff0a01fa6921d2f9ad8c4f541badabeeda65ea6caa1576018
|
|
| MD5 |
85c2354a52e7fb60384a1d517542a6bd
|
|
| BLAKE2b-256 |
5162f7eef6863f478d85b13d94c73601703d052b739513af6964ba69385cf60a
|
Provenance
The following attestation bundles were made for decibri-0.2.0-cp310-abi3-win_amd64.whl:
Publisher:
publish-pypi.yml on decibri/decibri
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
decibri-0.2.0-cp310-abi3-win_amd64.whl -
Subject digest:
892f40c09cca734ff0a01fa6921d2f9ad8c4f541badabeeda65ea6caa1576018 - Sigstore transparency entry: 1674026065
- Sigstore integration time:
-
Permalink:
decibri/decibri@007618ec7e71707186e079eb706758b9b06ac4ee -
Branch / Tag:
refs/tags/python-v0.2.0 - Owner: https://github.com/decibri
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@007618ec7e71707186e079eb706758b9b06ac4ee -
Trigger Event:
push
-
Statement type:
File details
Details for the file decibri-0.2.0-cp310-abi3-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: decibri-0.2.0-cp310-abi3-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 3.1 MB
- Tags: CPython 3.10+, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
03cff92b36b7449a1c8c808443abc26d33f73d2b13339027dfb228961d258b4e
|
|
| MD5 |
2ce702372faf517150b1024a6c21e5ed
|
|
| BLAKE2b-256 |
a78eeb226d6bc6d0248b95e9d6804217168fa78c74c8146d347842bc52eb9906
|
Provenance
The following attestation bundles were made for decibri-0.2.0-cp310-abi3-manylinux_2_28_x86_64.whl:
Publisher:
publish-pypi.yml on decibri/decibri
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
decibri-0.2.0-cp310-abi3-manylinux_2_28_x86_64.whl -
Subject digest:
03cff92b36b7449a1c8c808443abc26d33f73d2b13339027dfb228961d258b4e - Sigstore transparency entry: 1674026025
- Sigstore integration time:
-
Permalink:
decibri/decibri@007618ec7e71707186e079eb706758b9b06ac4ee -
Branch / Tag:
refs/tags/python-v0.2.0 - Owner: https://github.com/decibri
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@007618ec7e71707186e079eb706758b9b06ac4ee -
Trigger Event:
push
-
Statement type:
File details
Details for the file decibri-0.2.0-cp310-abi3-manylinux_2_28_aarch64.whl.
File metadata
- Download URL: decibri-0.2.0-cp310-abi3-manylinux_2_28_aarch64.whl
- Upload date:
- Size: 3.1 MB
- Tags: CPython 3.10+, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cf4330dea201037cc2c0e7c33f7644d3c4700708a93e17a2699b96a2025c6b61
|
|
| MD5 |
93818e683deba771dc5c868394f3bfaf
|
|
| BLAKE2b-256 |
5b1c2cd9c7727b78c0ac6759aa3726fe41f2f44aa870b03fe94d56b644d83c28
|
Provenance
The following attestation bundles were made for decibri-0.2.0-cp310-abi3-manylinux_2_28_aarch64.whl:
Publisher:
publish-pypi.yml on decibri/decibri
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
decibri-0.2.0-cp310-abi3-manylinux_2_28_aarch64.whl -
Subject digest:
cf4330dea201037cc2c0e7c33f7644d3c4700708a93e17a2699b96a2025c6b61 - Sigstore transparency entry: 1674026163
- Sigstore integration time:
-
Permalink:
decibri/decibri@007618ec7e71707186e079eb706758b9b06ac4ee -
Branch / Tag:
refs/tags/python-v0.2.0 - Owner: https://github.com/decibri
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@007618ec7e71707186e079eb706758b9b06ac4ee -
Trigger Event:
push
-
Statement type:
File details
Details for the file decibri-0.2.0-cp310-abi3-macosx_14_0_arm64.whl.
File metadata
- Download URL: decibri-0.2.0-cp310-abi3-macosx_14_0_arm64.whl
- Upload date:
- Size: 12.3 MB
- Tags: CPython 3.10+, macOS 14.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
64d6720caa8e3131f26d251045665230684d31ce7b617b1a3aab8ba9a2de71fd
|
|
| MD5 |
b7443773cfbec8db7da900c1bfc240a2
|
|
| BLAKE2b-256 |
cbed2a021dbaef4c0aa8ab6a217a169071b11f15575ecd21350bd48ee7d8545b
|
Provenance
The following attestation bundles were made for decibri-0.2.0-cp310-abi3-macosx_14_0_arm64.whl:
Publisher:
publish-pypi.yml on decibri/decibri
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
decibri-0.2.0-cp310-abi3-macosx_14_0_arm64.whl -
Subject digest:
64d6720caa8e3131f26d251045665230684d31ce7b617b1a3aab8ba9a2de71fd - Sigstore transparency entry: 1674026108
- Sigstore integration time:
-
Permalink:
decibri/decibri@007618ec7e71707186e079eb706758b9b06ac4ee -
Branch / Tag:
refs/tags/python-v0.2.0 - Owner: https://github.com/decibri
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@007618ec7e71707186e079eb706758b9b06ac4ee -
Trigger Event:
push
-
Statement type: