A modern mp3gain / aacgain replacement written in Rust. mp3rgain adjusts volume by rewriting the global_gain field in each frame — no re-encoding, no quality loss, fully undoable. The only actively maintained CLI for lossless AAC/M4A bitstream gain.
For two decades, mp3gain and aacgain were the way to run a ReplayGain scan and then make the result permanent — tags written, gain baked in, quality untouched. Both are abandoned.
Full comparison: mp3rgain vs mp3gain, aacgain, rsgain and ffmpeg →
MP3 and AAC frames carry a global_gain field that scales decoder output. mp3rgain rewrites it in every frame (1 step = 1.5 dB), records an mp3gain-compatible undo tag, and never touches the compressed audio data. Same CLI, same TSV output, same undo tags as the original mp3gain — your scripts and beets configs keep working.
Everything the classic tools did — plus the parts they never got to.
Gain changes via global_gain rewrite — the compressed audio data is never decoded or re-encoded. Quality preserved bit-exactly, for MP3 and AAC/M4A.
Every change is recorded in mp3gain-compatible undo tags. mp3rgain -u restores originals exactly — including AAC, where no other maintained tool offers an undo path.
Identical CLI flags, TSV output, and APEv2 undo tags. Existing scripts, Dockerfiles, and beets configs keep working — migration is a one-line sed.
ReplayGain 1.0 by default for mp3gain-identical values. Opt-in --rg2 / --r128 switch to BS.1770 gated loudness (−18 / −23 LUFS), consistent with loudgain and ffmpeg.
One static binary. No ffmpeg, no mp3gain, no aacgain. Pure-Rust decoding via Symphonia, memory-safe by construction.
ReplayGain Track/Album analysis runs multi-threaded by default. Tune with -j, or -j 1 for the legacy serial path.
mp3rgui: drag-and-drop desktop app for macOS / Windows / Linux, sharing the exact same processing pipeline as the CLI.
Multi-arch (amd64/arm64) FROM scratch image on GHCR. Drop into containerized batch jobs — e.g. Plex library maintenance.
Embed lossless gain in your own tools via the mp3rgain crate — it powers Bake'n Deck's DJ loudness pipeline.
macOS, Linux, Windows — x86_64 and ARM64. Packaged for Homebrew, winget, AUR, PPA, Debian, Nix, MacPorts, Docker, and crates.io.
Uninstall commands, checksum verification and troubleshooting are on the full install guide · every flag is documented in the CLI reference · pre-built binaries on GitHub Releases.
Same lossless pipeline, zero terminal required. Drop in files or folders, analyze, apply, undo.
mp3rgain ships on nine distribution channels — GitHub Releases, crates.io, Homebrew, winget, AUR, PPA, Debian, MacPorts, and GHCR. Weekly download trends across all of them are tracked on a public dashboard.
View Download Statistics