Music collection/playing notes

From Helpful
Revision as of 15:58, 24 November 2010 by Helpful (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


Replay-gaining of digital music means ensuring that all your music plays at the same volume level, so that you don't have to frequently run to your volume dial.

Well, approximately the same volume. For example, classical music may well have long subtle bits and occasional loudness, and the '...same volume on average' becomes pretty clear. Most modern music is approximately the same anyway because of dynamic compression.

There are programs to do this for you. They adjust towards a given level , and depending on the files in question may either tag the file to note the adjustment necessary, or alter the file to play at that level (this is fairly simply in MP3 without re-encoding: a frame's gain is a field you can easily pick out and alter without any other decoding).

When you use the tagging method (when you have files for which that's necessary), your player will have to support it too.

Where per-track replay-gaining calculates the volume level of a track and then tags/adjusts it for that track (which usually applies a different gain to each track), per-album replay-gaining calculates the average volume for an album and applies the same adjustment for all tracks in the album.

The difference matters when an album has songs that smoothly flow into each other and you want to play it that way, without noticeable volume jumps

On linux

The following does track gain (and forgets album consistency).

Install mp3gain and, if you use it, vorbisgain (usually present in distro packages).

The commands:

nice -n 19  ionice -c3  find /data/Music -iname '*.ogg' -exec vorbisgain -f -s \{\} \;
nice -n 19  ionice -c3  find /data/Music -iname '*.mp3' -exec mp3gain -r -k \{\} \;

The basic niceness is for non-aggressive CPU use, the ionice for non-aggressive disk use (if you don't have ionice, omit the ionice -c3).

You can use cron to run this, say, once a week, at 3AM or some other time you won't notice.

Option comments for vorbisgain:

  • -f means it will only calculate for files when a tag isn't present. (should be default behaviour, really)
  • -s makes it more robust when you accidentally hand a bad file to vorbis (since the above hands ten files at a time, without this it may mean the ones after a bad file wouldn't get updated)

Option comments for mp3gain:

  • -r means track gain,
  • -k means lowering the target volume if the default means it will clip somewhere. (no distortion is more important to me than exactly the same volume)