?! HowTheFu.cc ?!
<< Recipe: Christmas Star Cookies
 

2025.08.12
Linux: Adding ReplayGain To Your Music

Resources:

Explanation Summary

Modify Files

Install rsgain (linked above). Then:


# If 
# - you want to use "Album Loudness", and 
# - your music directory has each album in its own directory,
# you can compute and add the tags as follows:
> rsgain easy -m [Number of CPU Threads] [Path To Your Music Directory]

# If you just want to use Track Loudness:
> rsgain easy -p no_album -m [Number of CPU Threads] [Path To Your Music Directory]

# Add "-S" if you want rsgain to skip processing of files
# which already have tag information 
# (in the format used by rsgain, even if different settings are used)

# You also can do more complicated adjustments on a file-by-file basis.
# For more info, see:
> rsgain custom --help

You can confirm that the files have received tags with ffprobe:


> ffprobe [path to file]

[...]
Metadata: 
  ...
  REPLAYGAIN_TRACK_GAIN: -0.98 dB
  REPLAYGAIN_TRACK_PEAK: 0.943695
  REPLAYGAIN_ALBUM_GAIN: -0.08 dB
  REPLAYGAIN_ALBUM_PEAK: 0.994293
  ...

Ensure MPV Uses Loudness Tags

Add the following to your settings file ~/.config/mpv/mpv.conf:


# To use Album Loudness (and fallback to Track loudness if it doesn't exist), add:
replaygain=album

# To only use Track Loudness:
replaygain=track

# Ignore Loudness Tags:
replaygain=no


<< Recipe: Christmas Star Cookies
 
?! HowTheFu.cc ?!