COOLJAPAN
← All posts

OxiAudio 0.2.0 — A Pure Rust Audio Codec + DSP Layer (the NoFFI replacement for libFLAC, libvorbis, libopus & dr_libs)

OxiAudio is the COOLJAPAN Pure-Rust audio codec and DSP layer — decode FLAC/WAV/MP3/Vorbis/AAC/ALAC/Opus/WavPack/Musepack/MIDI and encode WAV/RF64/FLAC/AIFF/AU with no FFI, plus a full DSP toolkit (filters, dynamics, reverb, phase vocoder, pitch detection, EBU R128 loudness, MFCC/STFT). A clean, memory-safe alternative to libFLAC, libvorbis, libopus, and dr_libs — part of the NoFFI / COOLJAPAN sovereign Rust stack.

release oxiaudio pure-rust cooljapan noffi audio codec dsp signal-processing

Audio in Rust has lived too long on a foundation of C: libFLAC, libvorbis, libopus, the dr_libs headers, and a tangle of -sys crates. Today that foundation gets a Pure-Rust replacement.

Today we’re releasing OxiAudio 0.2.0 — the COOLJAPAN Pure-Rust audio codec and DSP layer: decode, encode, DSP effects, and spectral analysis, all in one workspace.

No libFLAC. No libvorbis. No libopus. No dr_libs. No FFI. No -sys crates. Default features carry zero C/C++/Fortran dependencies — just clean, memory-safe Rust that compiles to a single binary and goes wherever Rust goes.

Why OxiAudio

For decades, reading and writing audio from Rust meant binding to C. Decoding a FLAC file pulled in libFLAC. Vorbis and Opus meant libvorbis and libopus. The convenient single-header dr_libs decoders are great C, but they are still C — with the build-time toolchain, the unsafe boundary, and the platform-specific linking headaches that come with every native dependency. You inherited someone else’s memory model, and you shipped it in your binary.

OxiAudio ends that. The whole stack — the codecs, the DSP, the tagging, the streaming pipeline — is Rust. Default features are 100% Pure Rust, so there is no system library to install, no C compiler to invoke at build time, and nothing to break when you cross-compile or target WASM. The one exception is intentional and quarantined: MP3 encoding via LAME (LGPL) is the sole sanctioned FFI boundary, and it is opt-in through a separate crate that never touches the default or --all-features closure.

What we built

OxiAudio is a six-crate workspace behind a single oxiaudio facade (default features = ["pure"]):

oxiaudio/                    (facade — default = ["pure"])
  oxiaudio-core              (AudioBuffer, traits, error, IPC, ring buffer, surround layouts)
  oxiaudio-decode            (SymphoniaDecoder + AIFF/AU/Opus/WavPack/Musepack/MIDI)
  oxiaudio-encode            (WAV/RF64, FLAC, AIFF, AU, ID3v2.4, APEv2; streaming + two-pass)
  oxiaudio-encode-mp3-lame   (LAME FFI adapter — opt-in, never default)
  oxiaudio-dsp               (resample, filters, dynamics, reverb, pitch, spectral, loudness)

1. Format support — read almost anything, write the formats that matter

On the decode side OxiAudio reads WAV/RF64, FLAC, AIFF / AIFF-C, AU / SND, MP3, OGG Vorbis, AAC / M4A, ALAC, Opus, WavPack, Musepack (SV7/SV8), and MIDI (SMF 0/1/2) — all Pure Rust. On the encode side it writes WAV / RF64, FLAC, AIFF, AU, and Opus (with a Pure-Rust CELT/SILK/Hybrid encoder), again with no FFI. MP3 encoding is available too, but only through the opt-in LAME quarantine crate.

2. A full DSP toolkit, not just codecs

oxiaudio-dsp is a complete signal-processing layer:

3. Multi-channel and surround

OxiAudio understands surround properly: Quad, 5.1, 7.1, 5.1-Side, and Atmos 7.1.4 layouts; a ChannelMap / ChannelId model with SMPTE / ITU-R BS.775 ordering; downmix (5.1 → stereo, N-ch → mono) and upmix utilities per ITU-R BS.775; and WAVE_FORMAT_EXTENSIBLE for writing WAV files with more than two channels.

4. Real tagging and advanced encoding

The encoder is more than a sample writer. It supports RF64 / BW64 WAV for files exceeding 4 GB, FLAC album art via METADATA_BLOCK_PICTURE (encode_flac_with_album_art), a full ID3v2.4 writer (UTF-8, APIC album art, USLT lyrics, extended-header CRC, ReplayGain), and an APEv2 tag writer for WavPack/Musepack output. For mastering it offers two-pass EBU R128 loudness normalization (−14 / −16 / −23 LUFS targets) and noise-shaped, ATH-weighted dithering for perceptually optimal bit-depth reduction.

5. A pipeline you can build on

For real-world apps OxiAudio ships streaming and pipeline primitives: a TranscodeStream streaming transcode pipeline (decode → optional DSP → encode), transcode_batch for parallel batch conversion via rayon, a composable DspChain effect builder, an AudioRingBuffer<T> lock-free SPSC ring buffer with a wait-free overflow policy, an AudioPipeline with parallel branches, bypass/mute, and latency reporting, and an AudioClock reporting drift_ppm, elapsed_frames, and elapsed_secs.

Getting Started

cargo add oxiaudio

A few lines take you from any supported file, through DSP, back out to FLAC:

use std::path::Path;

// Decode any supported format
let buf = oxiaudio::decode_file(Path::new("input.flac")).expect("decode failed");
println!("{} frames @ {} Hz", buf.frame_count(), buf.sample_rate);

// DSP: normalize, then add reverb
let mut out = buf.clone();
oxiaudio::dsp::normalize(&mut out, -1.0);
let with_reverb = oxiaudio::dsp::reverb(&out, 0.6, 0.4, 0.3);

// Re-encode as FLAC
oxiaudio::encode_flac(&with_reverb, Path::new("output.flac")).expect("encode failed");

Highlights

Tips

Part of the COOLJAPAN ecosystem

OxiAudio is part of NoFFI — the COOLJAPAN initiative to replace every C/C++/Fortran/-sys FFI dependency in the Rust world with a clean, memory-safe, 100% Pure Rust implementation. Where the old way meant linking libFLAC, libvorbis, libopus, and dr_libs, OxiAudio gives you the same capabilities in a single static binary with no system libraries and no build-time C toolchain. Its spectral layer is built on OxiFFT, the ecosystem’s Pure-Rust FFT, and it sits alongside the other oxi* projects building a sovereign Rust stack from the ground up.

Repository: https://github.com/cool-japan/oxiaudio

Star the repo if you want audio in Rust that you can read, audit, and ship without ever linking a line of C.

Pure Rust audio — sovereign, safe, and FFI-free.

KitaSan at COOLJAPAN OÜ June 22, 2026

↑ Back to all posts