A single file audio playback and capture library.
miniaudio is a single file audio playback and capture library written in C. Written from scratch, it has no
external dependencies with the exception of the C standard library and necessary platform-specific backends.
It Just Works
Just add to your source tree and go. There's no need to install any dependencies or development
packages, nor are there any build systems to waste time on.
miniaudio works on all the major desktop and mobile platforms, including Windows, macOS,
Linux, BSD, iOS, Android and Web (via Emscripten).
miniaudio has a simple, yet flexible low-level API that gets out of your way. Just initialize a
device and start sending audio data via a callback.
And best of all, it's free and open-source!
You can find miniaudio on GitHub
- Supports playback, capture, full-duplex and loopback (WASAPI only).
- Device enumeration for connecting to specific devices, not just defaults.
- Connect to multiple devices at once.
- Shared and exclusive mode on supported backends.
- Backend-specific configuration options.
- Device capability querying.
- Automatic data conversion between your application and the internal device.
- Sample format conversion with optional dithering.
- Channel conversion and channel mapping.
- Resampling with support for multiple algorithms.
- Simple linear resampling with anti-aliasing.
- Optional Speex resampling (must opt-in).
- Low-pass (first, second and high order)
- High-pass (first, second and high order)
- Second order band-pass
- Second order notch
- Second order peaking
- Second order low shelf
- Second order high shelf
- Waveform generation.
- Noise generation.
- Decoding (requires external single-file libraries).
- WAV via dr_wav
- FLAC via dr_flac
- MP3 via dr_mp3
- Vorbis via stb_vorbis
- Encoding (requires external single-file libraries).
- Lock free ring buffer (single producer, single consumer).
- Your choice of either public domain or MIT No Attribution.
- Entirely contained within a single file for easy integration into your source tree.
- No external dependencies except for the C standard library and backend libraries.
- Written in C and compilable as C++, enabling miniaudio to work on almost all compilers.
- Supports all major desktop and mobile platforms, with multiple backends for maximum compatibility.
- WASAPI (Windows Vista+)
- DirectSound (Windows XP+)
- WinMM (Windows)
- Core Audio (macOS, iOS)
- ALSA (Linux)
- PulseAudio (Cross platform, disabled on Windows, BSD and Android)
- JACK (Cross platform, disabled on BSD and Android)
- sndio (OpenBSD)
- audio(4) (NetBSD, OpenBSD)
- OSS (FreeBSD)
- AAudio (Android 8+)
- OpenSL|ES (Android API level 16+)
- Web Audio (Web, via Emscripten)
- Null (Cross platform, not used on Web)
Copyright © 2020 David Reid
Developed by David Reid -