A comprehensive Rust library for handling FLAC files.
This library implements RFC9639 to process FLAC files according to the standard in a safe, performant fashion with a straightforward API.
- Read any single metadata block from a file
- Read all the metadata blocks from a file
- Update a file's metadata blocks with a single function call
- Decode FLAC files to bytes in some endianness (useful for storing in other PCM containers, like .wav files)
- Decode FLAC files to signed integer samples (audio playback system libraries often require these)
- Decode subset FLAC files from raw "subset" streams
- Can decode from paths on disk, or from any input stream that
implements
std::io::Read
- Provides an easy reading API
- If you need bytes, the byte reader simply implements
std::io::Read
- If you need samples, a
Read
-like trait for signed integers is also provided
- If you need bytes, the byte reader simply implements
- Offers seekable readers the underlying stream is also seekable
- Encode FLAC files from bytes in some endianness (again, useful for encoding data from raw PCM containers)
- Encode FLAC files from signed integer samples
- Encode FLAC files into raw "subset" streams
- Can encode to paths on disk, or to any output stream
that implements both
std::io::Write
andstd::io::Seek
- Provides an easy writing API
- If you can provide bytes, there's an encoder that implements
std::io::Write
- If you can provide samples, a
Write
-like interface is also provided
- If you can provide bytes, there's an encoder that implements
- Encoding process modeled on the reference implementation's and achieves similar compression when using identical parameters
- Offers multithreaded encoding via the optional
rayon
feature for better performance
- Parses FLAC files to Rust data structures
- Can rebuild FLAC files from those same data structures
- Is able to round-trip files that are byte-for-byte identical to the originals
- Verified against tests ported from the reference implementation
- Handles the entire FLAC decoder testbench suite
- Tested against my personal collection of nearly 200,000 FLAC files