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, and -u undoes it. As far as we know, the only actively maintained CLI for lossless AAC/M4A bitstream gain.
DJ prepping tracks for rekordbox and CDJs? Bake'n Deck is built on the same engine. More below ↓
For two decades, mp3gain and aacgain were the way to run a ReplayGain scan and make the result permanent: tags written, gain baked in, quality untouched. Neither has shipped a release in years.
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), writes ReplayGain tags and an undo tag, and never touches the compressed audio data. Flags, TSV output and undo tags follow mp3gain, so most scripts and beets configs keep working.
Everything the classic tools did, plus the parts they never got to.
Gain changes go through the global_gain field; the compressed audio data is never decoded or re-encoded. Works for MP3 and AAC: in M4A/MP4, in the audio track of a video MP4, and as a raw ADTS .aac stream.
Every gain change is recorded in an undo tag (mp3gain's own on MP3). mp3rgain -u puts every frame back to its original gain, on AAC too.
mp3gain's flags, TSV output and APEv2 undo tags. Most scripts, Dockerfiles and beets configs keep working after a one-line sed; the few differences are documented.
ReplayGain 1.0 by default, landing on the same gain steps as mp3gain. Opt-in --rg2 / --r128 switch to BS.1770 gated loudness (−18 / −23 LUFS), consistent with rsgain and ffmpeg.
One binary. No ffmpeg, mp3gain or aacgain needed. Decoding uses the pure-Rust Symphonia library, and mp3rgain's own code has no unsafe blocks.
Files are analysed and written on all CPU cores. Tune with -j, or use -j 1 for a serial run.
mp3rgui: a drag-and-drop app for macOS, Windows and Linux, built on the same processing code as the CLI.
Multi-arch (amd64/arm64) FROM scratch image on GHCR, for containerized batch jobs such as Plex library maintenance.
Embed lossless gain in your own tools with the mp3rgain crate. It powers Bake'n Deck's DJ loudness pipeline.
macOS, Linux and Windows, on x86_64 and ARM64. Available through Homebrew, MacPorts, winget, AUR, an apt repository for Debian and Ubuntu, Nix, pkgx, Termux, Docker and crates.io.
CDJs and other DJ hardware ignore ReplayGain tags, and rekordbox Auto Gain never makes it onto the USB stick. Bake'n Deck is a rekordbox → CDJ prep toolkit by the same author, with mp3rgain built in as its MP3/AAC engine. It writes your prep into the files themselves.
Gain only, no limiter. Raises or lowers each track to a −0.5 dBTP true peak ceiling: MP3 and AAC in lossless 1.5 dB steps via mp3rgain, FLAC, AIFF, WAV and ALAC with exact gain. Cues and beatgrids stay linked.
Orders every playlist by Alphanumeric key, then BPM, inside your exported rekordbox XML, so the CDJ plays it in exactly that order.
Transcodes a playlist to 320 kbps CBR MP3 with cues and beatgrid carried over: the backup USB for CDJs that only play MP3 reliably.
Free MIT-licensed CLI for macOS, Windows and Linux (brew install M-Igashi/tap/baken · winget install M-Igashi.baken), plus a native Mac app on the Mac App Store · 日本語
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 processing, no terminal required. Drop in files or folders, analyze, apply, undo.
Download counts from GitHub Releases (which Homebrew and winget install from), crates.io, AUR, the Ubuntu PPA and GHCR are collected daily on a public dashboard.
View Download Statistics