mp3rgain is a modern tool designed for lossless MP3 volume adjustment by modifying the global_gain field in each frame's side information. This approach preserves audio quality while enabling permanent volume changes without re-encoding.
Key Features:
Lossless & Reversible Adjustments: Volume changes are applied directly to the file, allowing for reversible adjustments without any loss of audio quality.
ReplayGain Analysis: Supports track and album gain analysis, ensuring consistent listening levels across tracks or albums.
AAC/M4A Support: Compatible with AAC and M4A files, expanding its utility beyond MP3s.
Cross-Platform Compatibility: Works seamlessly on macOS, Linux, and Windows (including x86_64 and ARM64 architectures).
Command-Line Compatibility: Fully compatible with the original mp3gain command-line interface, providing a familiar workflow for users.
Audience & Benefit:
Ideal for audiophiles, music producers, and anyone requiring precise volume control over their audio files. By eliminating the need for re-encoding, mp3rgain ensures that adjustments are lossless, maintaining the highest possible audio quality while achieving consistent listening levels across tracks or albums.
The software can be installed via winget on Windows for a streamlined experience.
README
mp3rgain
Lossless MP3 volume adjustment - a modern mp3gain replacement written in Rust
mp3rgain adjusts MP3 volume without re-encoding by modifying the global_gain field in each frame's side information. This preserves audio quality while achieving permanent volume changes.
Features
Lossless & Reversible: No re-encoding, all changes can be undone
ReplayGain: Track and album gain analysis with AAC/M4A support
Zero dependencies: Single static binary (no ffmpeg, no mp3gain)
Cross-platform: macOS, Linux, Windows (x86_64 and ARM64)
mp3gain compatible: Drop-in replacement with identical CLI
GUI Application: Native desktop app for drag-and-drop workflow
# Normalize a single track (ReplayGain)
mp3rgain -r song.mp3
# Normalize an album
mp3rgain -a *.mp3
# Manual gain adjustment (+3.0 dB)
mp3rgain -g 2 song.mp3
# Undo changes
mp3rgain -u song.mp3
# Show file info
mp3rgain song.mp3
The original mp3gain has been unmaintained since ~2015. mp3rgain is a modern, memory-safe replacement that works on current systems including Windows 11, macOS, and Linux.
ReplayGain Algorithm
mp3rgain implements the original ReplayGain 1.0 algorithm, the same as the classic mp3gain/aacgain:
This is a deliberate choice to maintain full compatibility with the original mp3gain. Loudness values will differ from tools using EBU R128/LUFS-based analysis (such as foobar2000's ReplayGain scanner, loudgain, or ffmpeg's loudnorm filter), which use a -23 LUFS reference level.
Library Usage
use mp3rgain::{apply_gain, analyze};
use std::path::Path;
let frames = apply_gain(Path::new("song.mp3"), 2)?; // +3.0 dB
let info = analyze(Path::new("song.mp3"))?;