|
DSPark 1.6.1
Header-only audio DSP framework in pure C++20 — zero dependencies
|
High-performance, pure C++ WAV file reader/writer. More...
#include "AudioFile.h"#include <algorithm>#include <cmath>#include <cstdint>#include <cstring>#include <filesystem>#include <fstream>#include <type_traits>#include <vector>

Go to the source code of this file.
Classes | |
| class | dspark::WavFile |
| Complete WAV file reader and writer in pure C++20. More... | |
Namespaces | |
| namespace | dspark |
| Main namespace for the DSPark framework. | |
High-performance, pure C++ WAV file reader/writer.
Provides bit-accurate parsing and encoding of standard and Extensible WAV files with cache-friendly channel-major conversion loops.
Supports the following formats:
Floating-point conversions to integer formats apply correct mathematical rounding to avoid DC offsets and harmonic distortion caused by simple truncation. Endianness is handled safely via byte-wise reconstruction to avoid Undefined Behavior (UB) on non-x86 architectures.
The writer targets classic RIFF/WAVE, whose 32-bit sizes cap a file at 4 GiB: writeSamples() refuses (returns false) any write that would overflow that limit instead of silently corrupting the header.
Threading: owner-managed. One instance serves one file from one thread at a time; no internal synchronization (see AudioFile.h).
Dependencies: IO/AudioFile.h (Core/AudioBuffer.h, Core/AudioSpec.h).
Definition in file WavFile.h.