mackron/dr_libs
FreeAudio decoding libraries for C/C++, each in a single source file.
FreeFree tier
About mackron/dr_libs
Public domain, single-file audio decoding libraries for C and C++. The collection includes dr_flac (FLAC audio decoder), dr_mp3 (MP3 audio decoder based on minimp3), and dr_wav (WAV audio loader and writer). All libraries are developed on the master branch and versioned with tags. Also offers miniaudio, a related single-file library for audio playback and recording.
Key Features
Single-file header-only implementations
Public domain license (no restrictions)
Supports FLAC, MP3, and WAV formats
dr_mp3 based on minimp3
dr_wav supports both loading and writing WAV files
C and C++ compatible
Active development with version tags
Lightweight and easy to integrate
Pros & Cons
Pros
- Public domain eliminates licensing concerns
- Single-file design simplifies integration into projects
- Supports three widely-used audio formats
- Lightweight footprint suitable for resource-constrained environments
- C/C++ compatibility allows use in many codebases
Cons
- Limited to FLAC, MP3, and WAV formats (no AAC, OGG, etc.)
- Only provides decoding except for WAV writing capability
- No built-in audio playback requires complementary library (miniaudio)
- Documentation is minimal (primarily the README)
Best For
Embedded systems audio decodingGame development audio asset loadingCross-platform audio processing applicationsMusic player componentsEducational projects for audio codec learning
FAQ
What audio formats are supported?
dr_flac decodes FLAC, dr_mp3 decodes MP3, and dr_wav loads and writes WAV files.
What license is used?
All libraries are public domain. The repository uses a LICENSE file indicating public domain.
Is dr_mp3 based on an existing decoder?
Yes, dr_mp3 is based off minimp3.
Are there other related libraries?
Yes, the author also provides miniaudio, a single-file library for audio playback and recording.