mcpp index

compat.dr_libs

dr_libs (2026.03.03: dr_wav 0.14.5, dr_flac 0.13.3, dr_mp3 0.7.3) — single-file WAV/AIFF, FLAC and MP3 decoders and a WAV encoder in C, no dependencies

mcpp add compat.dr_libs@2026.03.03

Usage

From this repository's own test project — built and run by CI, not written for the website.

// compat.dr_libs — dr_wav, dr_flac and dr_mp3, each through its own decoder.
//
// WHAT THIS ASSERTS AND WHY
//
// The package is one generated TU that defines the three *_IMPLEMENTATION
// macros; a build that dropped one would not link. Every check asks a decoder
// a question whose answer is fixed by the data, not by the decoder:
//
//   the versions         drwav/drflac/drmp3_version_string, the linked code's
//                        own strings: 0.14.5, 0.13.3, 0.7.3 (the pinned commit)
//   WAV round trip       PCM16 stereo written with drwav_init_memory_write,
//                        read back sample-exact, as s16 and as f32 (s / 32768),
//                        and the same samples through a Sony Wave64 container
//   IEEE float WAV       f32 written and read back bit-exact
//   mu-law WAV           the decoder's table equals drwav_mulaw_to_s16
//   FLAC                 2048 stereo frames (fixed-predictor/LPC subframes,
//                        Rice residuals, stereo decorrelation, 4 frames)
//                        decoded sample-exact against the integer signal the
//                        fixture was encoded from, whose MD5 is the one in its
//                        STREAMINFO; the vendor string from VORBIS_COMMENT;
//                        a seek into the third frame
//   MP3                  a 440 Hz sine, 22050 Hz mono, 32 kb/s with a LAME
// …

tests/examples/dr_libs/tests/dr_libs.cpp · project tests/examples/dr_libs

Build

targets
dr_libs (lib)
language
c++23
C standard
c11
import std
no
include dirs
*

Sources (1)

  • mcpp_generated/dr_libs_impl.c

Generated files

  • mcpp_generated/dr_libs_impl.c

Versions

VersionPlatforms Mirrorssha256
2026.03.03 latest LinuxWindowsmacOS CN GLOBAL b56be5930399…