Frequently Asked Questions
Answers to the questions that come up most often about lossless volume normalization with mp3rgain โ how the gain rewrite works, what is reversible, which formats are covered, and how it relates to the tools it replaces.
How does mp3rgain change volume without re-encoding?
MP3 and AAC frames carry a global_gain field that scales the decoded output. mp3rgain rewrites that field in every frame (1 step = 1.5 dB) โ the compressed audio data itself is never touched, so quality is preserved bit-exactly and the change is permanent on any player or device.
Is mp3rgain a drop-in replacement for mp3gain?
Yes. The CLI flags, the TSV output format, and the APEv2 mp3gain_undo tag are all mp3gain-compatible, so existing scripts, Dockerfiles, and parsers (e.g. beets) keep working unchanged. For most setups migration is a one-line sed substitution.
Can I undo a gain change?
Yes. mp3rgain records the previous state in mp3gain-compatible undo tags, and mp3rgain -u restores the original file exactly โ for both MP3 and AAC/M4A. This is a key difference from foobar2000's AAC gain feature, which has no undo path.
What replaced aacgain? Is there a maintained aacgain alternative?
aacgain has been unmaintained since ~2009 and rarely builds on modern 64-bit systems. mp3rgain is the only actively maintained CLI for lossless AAC/M4A bitstream gain adjustment โ cross-platform, scriptable, and undoable, with the same CLI conventions as mp3gain/aacgain.
How is this different from ReplayGain tags written by rsgain, loudgain, or ffmpeg?
It is a superset, not an alternative. mp3rgain runs the same kind of ReplayGain analysis and writes the standard REPLAYGAIN_TRACK_GAIN / REPLAYGAIN_ALBUM_GAIN tags too โ but it also applies the gain to the bitstream itself, so the corrected volume plays everywhere, including on the many hardware players, car stereos, and apps that ignore ReplayGain tags. By default it uses the ReplayGain 1.0 algorithm (89 dB reference) for full mp3gain compatibility; since v3.0, opt-in --rg2 and --r128 flags measure loudness with ITU-R BS.1770 (LUFS), consistent with those tools.
Does mp3rgain write ReplayGain tags?
Yes. When gain is applied, mp3rgain writes REPLAYGAIN_TRACK_GAIN and REPLAYGAIN_TRACK_PEAK โ plus REPLAYGAIN_ALBUM_GAIN and REPLAYGAIN_ALBUM_PEAK in album mode โ to APEv2, ID3v2 TXXX, or MP4 freeform tags depending on the format. Following mp3gain's convention, the values describe the residual gain left after the bitstream rewrite, so ReplayGain-aware players and ReplayGain-blind ones arrive at the same loudness. In the --rg2 and --r128 modes a REPLAYGAIN_ALGORITHM tag records which measurement was used. Use -s s to skip tag writing.
Does mp3rgain support EBU R128 or ReplayGain 2.0 loudness?
Yes, since v3.0. ReplayGain 1.0 stays the default so re-scans match mp3gain exactly, and two opt-in flags select ITU-R BS.1770 gated loudness measurement: --rg2 normalizes to the ReplayGain 2.0 reference of -18 LUFS and --r128 to the EBU R128 broadcast target of -23 LUFS. Measurements agree with ffmpeg ebur128 and libebur128-based tools within 0.05 LU. The GUI has a matching analysis mode selector.
Does mp3rgain need ffmpeg or other dependencies?
No. mp3rgain is a single static binary with zero external dependencies โ no ffmpeg, no mp3gain, no aacgain. Decoding for analysis is done by the pure-Rust Symphonia library built into the binary.
Does mp3rgain support FLAC, Opus or Vorbis?
Not for gain application. Those formats have no in-bitstream gain field equivalent to MP3/AAC global_gain, so there is nothing to rewrite losslessly. For those formats a tag-based tool such as rsgain is the right choice.
Is there a GUI version?
Yes. mp3rgui is a native desktop app (macOS, Windows, Linux) with drag-and-drop loading, parallel Track/Album ReplayGain analysis, an options panel mirroring the CLI flags, and an undo menu. Install via brew install --cask M-Igashi/tap/mp3rgui, winget install M-Igashi.mp3rgui, or yay -S mp3rgui.
How do I install mp3rgain?
macOS: brew install M-Igashi/tap/mp3rgain. Windows: winget install M-Igashi.mp3rgain. Arch Linux: yay -S mp3rgain-bin. Ubuntu 25.10: ppa:m-igashi/mp3rgain. Nix: nix profile install github:M-Igashi/mp3rgain. Docker: docker pull ghcr.io/m-igashi/mp3rgain:latest. Cargo: cargo install mp3rgain. Pre-built binaries for all platforms are on GitHub Releases.
Can I use mp3rgain in Docker or CI pipelines?
Yes. Official multi-arch images (linux/amd64, linux/arm64) are published to ghcr.io/m-igashi/mp3rgain. The image is FROM scratch with a fully static musl binary (~2 MB) and the binary as entrypoint, so all CLI flags work identically โ a drop-in replacement for mp3gain in containerized batch jobs, e.g. Plex library maintenance.
Will rewriting files break my backups or sync?
Applying gain rewrites the file, which updates its modification time and makes rsync, Syncthing and most backup tools re-transfer it. Pass -p to preserve the original timestamp if that matters for your setup.
Next
Not covered here? Open an issue on GitHub, or browse the download statistics and project documentation.