mackron/miniaudio logo

mackron/miniaudio

Free

Audio playback and capture library written in C, in a single source file.

FreeFree tier
Inputs: audioOutputs: audio
Type
Open Source

About mackron/miniaudio

miniaudio is a single-file, cross-platform audio playback and capture library written in C with no dependencies beyond the standard library. It provides both a low-level API for direct access to raw audio data and a high-level API for sound management, mixing, effects, and optional 3D spatialization. The library includes a flexible node graph system for advanced mixing and effect processing, resource management for loading sound files, and built-in decoding support for WAV, FLAC, and MP3 (encoding is WAV only). Additional features include data conversion, resampling, channel mapping, basic waveform and noise generation, and basic effects and filters. It supports all major desktop and mobile platforms and compiles cleanly on major compilers without external packages.

Key Features

Single-file C library with no external dependencies beyond the standard library
Low-level API for direct access to raw audio data
High-level API for sound management, mixing, effects, and optional 3D spatialization
Flexible node graph system for advanced mixing and effect processing
Built-in decoding support for WAV, FLAC, and MP3 (encoding for WAV only)
Data conversion, resampling, and channel mapping
Basic generation of waveforms and noise
Basic effects and filters
Cross-platform support for major desktop and mobile platforms
Simple build system with no external development packages required

Pros & Cons

Pros
  • Zero external dependencies – only requires standard C library
  • Single-file header makes integration trivial
  • Cross-platform support for Windows, macOS, Linux, iOS, Android, etc.
  • Both low-level and high-level APIs provide flexibility
  • Supports common audio formats (WAV, FLAC, MP3) out of the box
  • Active open-source project with frequent updates
Cons
  • Encoding is limited to WAV format only
  • Decoding is limited to WAV, FLAC, and MP3; no built-in support for formats like AAC, OGG, or Opus
  • Documentation may be sparse for advanced use cases (relies on examples and header comments)

Best For

Playing sound files in applications or gamesReal-time audio capture and processingAudio decoding and playback via low-level APIImplementing audio mixers and effect chainsEmbedded or resource-constrained audio applications needing a minimal dependency

FAQ

What is miniaudio?
miniaudio is a single-file, cross-platform audio playback and capture library written in C with no external dependencies beyond the standard library.
Is miniaudio free to use?
Yes, miniaudio is open source and free. The repository is hosted on GitHub under an open source license (see LICENSE file).
What platforms does miniaudio support?
All major desktop and mobile platforms are supported, including Windows, macOS, Linux, iOS, and Android.
What audio file formats are supported for decoding?
Built-in decoding supports WAV, FLAC, and MP3. Custom decoders can also be plugged in.
Can I encode audio with miniaudio?
Encoding is currently supported only for the WAV format.