Mixer
Voices, buses, fades, loops and resampling for your audio callback. Rendering allocates nothing and takes no lock.
features = ["mixer"]Decode, shape, measure, and encode.
One audio toolkit, written in safe Rust.
Nothing else to install.
audio.fade(0.8, 1.2, FadeCurve::EqualPower)?An immutable Audio holds your samples. Each operation returns a new one. Compose the steps you need, and keep the original.
Extract a clip, make it mono, resample to 16 kHz, and normalize its peak. The input stays untouched.
Read the getting-started guideuse audiobox::{AudioFormat, NormalizeOptions,
decode, encode};
fn prepare(bytes: &[u8]) -> audiobox::Result<Vec<u8>> {
let audio = decode(bytes)?;
let ready = audio
.cut(12.0, 30.0)?
.to_mono()
.resample(16_000)?
.normalize(NormalizeOptions::default())?;
encode(&ready, AudioFormat::Wav)
}Bring files, encoded bytes, or planar PCM. The codecs are part of the crate, so the same Rust pipeline travels with your application.
Explore formats and limits| Format | Read | Write |
|---|---|---|
| WAVPCM, float, G.711, IMA ADPCM | WAV / RF64 / BW64 | WAV¹ |
| AIFFPCM, float, G.711 | AIFF / AIFF-C | AIFF |
| CAF / AUPCM and G.711 | Yes | Yes |
| FLACNative lossless codec | Yes | Yes |
| MP3MPEG-1 / 2 / 2.5 Layer III | CBR / VBR | MPEG-1 CBR |
| Ogg Vorbis ISingle link, 1–8 channels | Yes | — |
| Ogg Opus | SILK / CELT / hybrid; 1–8 channels at 48 kHz; pre-skip and replay seeks | — |
¹ WAV writing supports PCM, float and G.711; no ADPCM encoder. MP3 encoding uses a simpler CBR model without VBR or psychoacoustic tuning. Read the release limitations.
Optional features add a real-time mixer, an 8-bit synthesizer that plays text scores, and sound effects drawn from a seed. Still no dependencies, and the same samples on every platform.
Voices, buses, fades, loops and resampling for your audio callback. Rendering allocates nothing and takes no lock.
features = ["mixer"]Pulse, triangle, saw and noise channels playing music written as text, offline or chunk by chunk.
features = ["synth"]Jumps, coins, lasers and explosions from a few parameters, or from a preset and a seed.
features = ["sfx"]Start with a few lines. Explore the rest when you need it.