miniaudio
python bindings for the miniaudio library and its decoders (mp3, flac, ogg vorbis, wav)
What it is and what it does
Miniaudio is a Python wrapper around the miniaudio C library that handles audio I/O across Linux, macOS, Windows, and other platforms. It lets you play, record, decode, and convert audio files and streams without managing low-level audio APIs yourself. The library supports WAV, FLAC, MP3, and Ogg Vorbis formats, and runs audio operations in background threads so your Python code doesn't block during playback or recording.
You interact with miniaudio through Python classes and enums rather than raw C integers. Audio samples are exposed as Python arrays with appropriately sized elements, and the library handles channel mixing, sample rate conversion, and format conversion. It also supports streaming large files and Icecast internet radio, making it suitable for both simple playback tasks and more complex audio pipelines.
Use it for:
- Play MP3 or FLAC files in a desktop application without external dependencies.
- Record audio from the system microphone and save it as WAV or convert to a different format.
- Decode an audio file to raw PCM samples for analysis, DSP, or machine learning pipelines.
- Convert between audio formats and sample rates across different channel configurations.
- Stream large audio files or internet radio without loading the entire file into memory first.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Miniaudio provides Python bindings for cross-platform audio playback, recording, decoding, and sample format conversion using the miniaudio C library.
Yes. Miniaudio is actively maintained, has no known vulnerabilities, uses a permissive MIT license, and provides a clean Pythonic interface to a mature cross-platform audio library. Install friction is moderate but manageable via prebuilt wheels. It is well-suited for projects needing audio playback, recording, or decoding without heavy dependencies.
Install
miniaudio on PyPI
pip
pip install miniaudiouv
uv add miniaudiopoetry
poetry add miniaudioInstalling miniaudio
Before you install
Medium install friction due to compiled wheel dependencies (cffi-based bindings). Wheels are provided for Python 3.10–3.13 across macOS, Linux, Windows, and ARM platforms. Repository is actively maintained with recent commits and no archived status.
License in practice
MIT license is permissive; you may use, modify, and distribute this package and its bundled miniaudio C library with minimal restrictions, provided you include the license notice.
Quickstart
pip install miniaudio
import miniaudio
# Get file info
info = miniaudio.get_file_info("music.mp3")
print(f"Duration: {info.duration}s")
# Stream and play
stream = miniaudio.stream_file("music.mp3")
with miniaudio.PlaybackDevice() as device:
device.start(stream)
Requires Python 3.8 or newer; audio operations run in background threads, so playback device context must remain open during playback.
Verify before relying
- Whether PyPy3 support (mentioned as working because it uses cffi) is actively tested or documented in CI.
- Performance characteristics for real-time recording or low-latency playback scenarios.
- Availability and maturity of Icecast internet radio streaming support mentioned in description.
- Typical sample rate and channel configurations supported for conversion operations.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 1 — cffi |
| Maintenance | actively maintained — 107 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 674,921/month — #5,388 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: miniaudio-1.71-cp310-cp310-macosx_10_9_x86_64.whl; miniaudio-1.71-cp310-cp310-macosx_11_0_arm64.whl; miniaudio-1.71-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; miniaudio-1.71-cp310-cp310-musllinux_1_2_x86_64.whl; miniaudio-1.71-cp310-cp310-win32.whl; miniaudio-1.71-cp310-cp310-win_amd64.whl; miniaudio-1.71-cp311-cp311-macosx_10_9_x86_64.whl; miniaudio-1.71-cp311-cp311-macosx_11_0_arm64.whl; miniaudio-1.71-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; miniaudio-1.71-cp311-cp311-musllinux_1_2_x86_64.whl; miniaudio-1.71-cp311-cp311-win32.whl; miniaudio-1.71-cp311-cp311-win_amd64.whl; miniaudio-1.71-cp312-cp312-macosx_10_13_x86_64.whl; miniaudio-1.71-cp312-cp312-macosx_11_0_arm64.whl; miniaudio-1.71-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; miniaudio-1.71-cp312-cp312-musllinux_1_2_x86_64.whl; miniaudio-1.71-cp312-cp312-win32.whl; miniaudio-1.71-cp312-cp312-win_amd64.whl; miniaudio-1.71-cp313-cp313-macosx_10_13_x86_64.whl; miniaudio-1.71-cp313-cp313-macosx_11_0_arm64.whl
Keywords: sound, audio, playback, recording, conversion, decoding
Tags
More Sound/Audio packages
Reads and writes audio files in formats like…
permissive · top 1,000 on PyPI
pydubPydub provides a high-level Python interface…
permissive · top 5,000 on PyPI
mutagenMutagen reads and writes audio metadata (tags)…
copyleft · top 5,000 on PyPI
torchaudioProvides PyTorch-based audio processing,…
permissive · top 5,000 on PyPI
moviepyMoviePy is a Python library for video editing…
permissive · top 5,000 on PyPI
tinytagReads metadata (artist, title, duration,…
permissive · top 5,000 on PyPI
lameencWraps LAME MP3 encoder for Python, providing…
copyleft · top 5,000 on PyPI
silk-pythonEncodes and decodes audio in SILK format, a…
permissive · top 15,000 on PyPI
SoundCardSoundCard plays and records audio across Linux,…
permissive · top 15,000 on PyPI
SigMFReads and writes Signal Metadata Format (SigMF)…
copyleft · top 15,000 on PyPI
audiofileReads and writes audio files across formats…
permissive · top 15,000 on PyPI
audiolabaudiolab loads, processes, and saves audio…
permissive · top 15,000 on PyPI
audioreadDecode audio files using whichever backend is…
permissive · top 5,000 on PyPI
playsoundPlays audio files (MP3, WAV) and URLs from…
permissive · top 15,000 on PyPI
fmod-toolkitExtracts and exports audio from FMOD sound bank…
permissive · top 15,000 on PyPI
pyfmodexPyfmodex provides Python bindings to the FMOD…
permissive · top 15,000 on PyPI