GitHub
v2.10.0 · MIT License · Rust

Lossless MP3/AAC
Volume Normalizer

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.

BEFORE · QUIET AFTER · +6.0 dB · LOSSLESS

The tools everyone used are gone

For two decades, mp3gain and aacgain were the way to permanently normalize volume without touching audio quality. Both are abandoned.

  • mp3gain — unmaintained upstream since ~2015
  • aacgain — unmaintained since ~2009, rarely builds on modern 64-bit systems
  • rsgain / loudgain / ffmpeg only write ReplayGain tags — ignored by non-compliant players, car stereos, and hardware devices
  • Re-encoding fixes volume but degrades quality with every pass
  • foobar2000's AAC gain is Windows GUI only, with no undo
ReplayGain tags vs baked-in gain
Analyze loudness (ReplayGain 1.0)
Write tags only → many players ignore them
mp3rgain: rewrite global_gain in the bitstream
→ correct volume on every player, losslessly

Bake the gain into the file — reversibly

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.

mp3rgain — album normalize
$ mp3rgain -a -k *.mp3 Analyzing 12 files (album mode, 8 threads)... 01-intro.mp3 track: +4.5 dB album: +3.0 dB 02-title.mp3 track: +1.5 dB album: +3.0 dB ... Applying album gain +3.0 dB (2 steps, clipping prevented) ✓ 12 files updated losslessly — undo anytime with: mp3rgain -u *.mp3 $ mp3rgain -u 01-intro.mp3 ✓ restored to original gain

Features

Everything the classic tools did — plus the parts they never got to.

🔊

Truly lossless

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.

↩️

Fully undoable

Every change is recorded in mp3gain-compatible undo tags. mp3rgain -u restores originals exactly — including AAC, which foobar2000 can't undo.

🔁

Drop-in mp3gain replacement

Identical CLI flags, TSV output, and APEv2 undo tags. Existing scripts, Dockerfiles, and beets configs keep working — migration is a one-line sed.

📦

Zero dependencies

One static binary. No ffmpeg, no mp3gain, no aacgain. Pure-Rust decoding via Symphonia, memory-safe by construction.

Parallel analysis

ReplayGain 1.0 Track/Album analysis runs multi-threaded by default. Tune with -j, or -j 1 for the legacy serial path.

🖥️

Native GUI included

mp3rgui: drag-and-drop desktop app for macOS / Windows / Linux, sharing the exact same processing pipeline as the CLI.

🐳

2 MB Docker image

Multi-arch (amd64/arm64) FROM scratch image on GHCR. Drop into containerized batch jobs — e.g. Plex library maintenance.

🦀

Rust library crate

Embed lossless gain in your own tools via the mp3rgain crate — it powers Bake'n Deck's DJ loudness pipeline.

🌍

Cross-platform

macOS, Linux, Windows — x86_64 and ARM64. Packaged for Homebrew, winget, AUR, PPA, Debian, Nix, MacPorts, Docker, and crates.io.

Install

CLI — mp3rgain

Scriptable, headless, CI-friendly
macOS (Homebrew)brew install M-Igashi/tap/mp3rgain
Windows (winget)winget install M-Igashi.mp3rgain
Arch Linux (AUR)yay -S mp3rgain-bin
Ubuntu 25.10 (PPA)sudo add-apt-repository ppa:m-igashi/mp3rgain && sudo apt install mp3rgain
Nix / NixOSnix profile install github:M-Igashi/mp3rgain
Docker (GHCR)docker pull ghcr.io/m-igashi/mp3rgain:latest
Cargocargo install mp3rgain

GUI — mp3rgui

Drag-and-drop desktop app
macOS (Homebrew)brew install --cask M-Igashi/tap/mp3rgui
Windows (winget)winget install M-Igashi.mp3rgui
Arch Linux (AUR)yay -S mp3rgui
Ubuntu 25.10 (PPA)sudo add-apt-repository ppa:m-igashi/mp3rgui && sudo apt install mp3rgui
Debian / Ubuntu (.deb)sudo apt install ./mp3rgui_*_amd64.deb

Pre-built binaries for every platform (incl. Debian .deb, macOS .dmg) on GitHub Releases.

The GUI — mp3rgui

Same lossless pipeline, zero terminal required. Drop in files or folders, analyze, apply, undo.

mp3rgui showing track and album ReplayGain analysis for a batch of files

Download Stats

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