ReplayGain is the name of a technique invented to achieve the same perceived playback loudness of audio files. Read more on Hydrogenaudio.
Set all files to 92db – this is the most used loudness now-a-days (it’s recommended also in Serato DJ software and most streaming platforms seems to use same value). You might want to use 89db if you are listening on a Hi-Fi system – in this case just ignore the -d 3 option.
The suggested loudness is ~89, so we add 3.
mp3gain -d 3 -c -p -r *.mp3
mp3gain -s r -d 3 -c -p -r *.mp3
-s r this will ignore the replaygain information already stored in the file
-c will ignore clipping warning, use -k to lower the gain to not clip
-p preserve original timestamp of files
-r gain per track (as opposed to per album), it’s good for collections, best of, etc.
recursively apply gain to all your mp3 files
- it works also for file names with spaces
find . -iname '*.mp3' -print0 | xargs -0 mp3gain -d 3 -c -p -r