vlac: A lossless audio codec for voice, written in Rust
说明与用途
vlac 是一个为 16 kHz 单声道语音音频设计的无损编解码器,使用 Order‑4 LPC 预测器和带训练字典的 Zstandard。它保证 100 % 位精确,支持 WebAssembly 编译,并可训练域特定字典,虽然在一般语音音频上比 FLAC 大 8 %。
问题
Need a lossless codec that preserves 16kHz mono voice audio with domain‑specific compression and WebAssembly support.
结果
vlac achieves 8 % larger files than FLAC on general voice audio but guarantees bit‑perfect output and supports domain‑specific dictionary training and WebAssembly compilation.
工作流
- Predict next sample using previous three samples (Order‑4 LPC).
- ZigZag encode the residuals.
- Split residuals into High and Low bytes for efficient Zstandard compression of zero‑padded High bytes.
- Compress the split residuals with Zstandard using trained dictionaries.
证据
I built vlac, a lossless audio codec designed specifically for 16kHz mono voice audio.
On a 10.75-second voice memo (337 KB WAV): Original WAV: 337 KB, FLAC (ffmpeg default): 151 KB, vlac: 163 KB
vlac currently produces files 8% larger than FLAC on general voice audio. However, it is 100% bit-perfect (verified via MD5 hash on the raw PCM data) and compiles to WebAssembly.
- 记录日期: 2026-10-21T11:41:28.347Z