skillfed

miniaudio

python bindings for the miniaudio library and its decoders (mp3, flac, ogg vorbis, wav)

miniaudio v1.71 674.9K downloads/30d#5,388 on PyPI185
Permissive license MIT Active released

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 miniaudio

uv

uv add miniaudio

poetry

poetry add miniaudio

Installing 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

Development Status :: 5 - Production/StableLicense :: OSI Approved :: MIT LicenseProgramming Language :: CProgramming Language :: PythonProgramming Language :: Python :: 3Topic :: Multimedia :: Sound/AudioTopic :: Multimedia :: Sound/Audio :: Capture/RecordingTopic :: Multimedia :: Sound/Audio :: ConversionTopic :: Multimedia :: Sound/Audio :: Players

Tags

audio playback recording pythonmp3 flac wav decodingaudio format conversioncross-platform audio librarypcm sample conversionaudio streaming playbackaudio device recording
audio-iocross-platformstreaming

More Sound/Audio packages