Skip to content

v3.2.0

Latest

Choose a tag to compare

@github-actions github-actions released this 11 Aug 22:41
· 2 commits to master since this release
ad78035

Behaviour change: ReplayGain tags now go to ID3v2 on MP3

If you script mp3rgain or parse its tags, read this before upgrading.

Previous versions wrote every tag to APEv2, because that is where mp3gain put them. That turns out to hide the ReplayGain values from essentially every player:

  • ffmpeg does not read APEv2 on MP3 at all. A well-formed APEv2 ReplayGain
    tag — correct APETAGEX header and footer, read back happily by mp3rgain
    itself — yields nothing from ffprobe -show_entries format_tags. That covers
    mpv, VLC, Kodi and everything else built on libavformat.
  • Rockbox handles APE tags only for WavPack and Musepack, not MP3.
  • foobar2000 writes ReplayGain to ID3v2 and expects it there.

The two tag families mp3rgain writes have different audiences, so as of 3.2.0 each one goes where its readers are:

Tag Container Read by
REPLAYGAIN_* ID3v2 TXXX Players. Also where foobar2000, rsgain and loudgain put theirs
MP3GAIN_UNDO, MP3GAIN_MINMAX APEv2 Nothing but the mp3gain lineage — which is why -u still rolls back a library mp3gain processed

Two flags override the split:

mp3rgain -r *.mp3          # default: ReplayGain in ID3v2, undo in APEv2
mp3rgain -r -s a *.mp3     # everything in APEv2 — byte-for-byte mp3gain
mp3rgain -r -s i *.mp3     # everything in ID3v2

Nothing about existing files breaks: the volume correction is baked into the frames, not the tags, so your library keeps playing at the corrected level.
Reading is forgiving in both directions — -s c merges both containers and -u finds the undo tag in either, so files tagged by mp3gain or by an older mp3rgain still inspect and roll back correctly. Re-running the default over an APEv2-tagged file moves the ReplayGain values to ID3v2 and clears the APEv2 copies, so the two can never drift apart. MP3GAIN_ALBUM_MINMAX stays
APEv2-only in every mode, and AAC/M4A is unaffected — it has always used MP4 freeform atoms.

Fix: album gain at 0 steps discarded all tags

In album mode (-a), an album gain that rounds to 0 steps returned early before any file was touched, throwing away the per-track REPLAYGAIN_* values that had just been measured. The reported case: album gain −0.04 dB, but track 3 wanted +1.46 dB, and the album got no tags at all.

The track path already handled this (#206); the album path never got the same treatment. The cheap skip is now kept only when no tags would be written (-s s) and -k has no clipping track to attenuate.

Testing

New tests/cli_tests.rs drives the built binary, so the command layer — which decides whether a file is processed — has coverage for the first time. Runs on Linux, macOS and Windows in CI.

Both changes were raised by skamp on the
Hydrogenaudio mp3rgain thread.
Thanks for the detailed report and advice.

Full Changelog: v3.1.1...v3.2.0