If you find yourself having to change the volume of your music player all the time, because the music in your collection is mastered at different volumes, replaygain is the solution. See Wikipedia eplanation of replaygain . In order to use replaygain for your mp3 files you will need the program mp3gain. See installation of mp3gain .
By default the program mp3gain will analyze the loudness of an mp3, and then alter the audio to change the perceived volume. The Dj Tagger tasks described in this example will instead use mp3gain for the analysis, but leave the audio of the mp3 alone. This has several advantages:
Of course the disadvantage is that your player has to support replaygain tags.
To add replaygain tags to your music files, all you have to do is save the following file, for example as replaygain.djt :
<tasks> <scanRoot>C:\Users\username\Music</scanRoot> <task class="printInfo" /> <task class="replayGain" /> </tasks>
This task file instructs DjTagger to analyze all your music files under C:\Users\username\Music and add replaygain tags to them. To execute this task in Windows, open a command prompt and type something like:
"C:\Program Files\DjTagger\djtagger.exe" replaygain.djt
If you or somebody else have previously used mp3gain on files in your collection, then either (as explained in goals ):
Such changes can be undone by the undoMp3Gain task of DjTagger. Note that this will not undo changes added by the replayGain task. It is intended to reverse changes made to songs by a manual execution of mp3gain. If there are no such changes, undoMp3Gain will do nothing.
A task file that first undoes changes by a manual execution of mp3gain.exe , and then analyses your songs and writes correct replaygain tasks will look like:
<tasks> <scanRoot>C:\Users\username\Music</scanRoot> <task class="printInfo" /> <task class="undoMp3Gain" /> <task class="replayGain" /> </tasks>
If you open your scanned files in a tag editor, you will see that DjTagger added the following tags: replaygain_track_gain , replaygain_track_peak , replaygain_album_gain , and replaygain_album_peak . However the album and track values are the same! This is because DjTagger does not now how to discriminate between albums yet, so each track is considered belonging to an album with just that track.
The albumInfo task can be used to correctly discriminate between albums. It uses the concept of an albumId to achieve that: tracks with the same id belong to the same album. Use expression language to define an albumId . An example:
<tasks> <scanRoot>C:\Users\username\Music</scanRoot> <task class="printInfo" /> <task class="albumInfo"> <albumId>${albumArtists}:${album}</albumId> </task> <task class="undoMp3Gain" /> <task class="replayGain" /> </tasks>
Now DjTagger will consider all songs for which the album artists tag and the album title tags are identical to be on the same album. Album gain tags for songs in an album are computed by determining the perceived volume of the entire album.
The above album definition still has two problems:
Possible alternatives for the above configuration would be:
<tasks> <scanRoot>C:\Users\username\Music</scanRoot> <task class="printInfo" /> <task class="albumInfo"> <isNotAnAlbum>${(empty albumArtists && empty artists) || empty album}</isNotAnAlbum> <albumId>${empty albumArtists ? artists : albumArtists}:${album}</albumId> </task> <task class="undoMp3Gain" /> <task class="replayGain" /> </tasks>
<tasks> <scanRoot>C:\Users\username\Music</scanRoot> <task class="printInfo" /> <task class="albumInfo"> <isAlbum>${!(empty album)}</isAlbum> <albumId>${path}</albumId> </task> <task class="undoMp3Gain" /> <task class="replayGain" /> </tasks>
Information about mp3gain: mp3gain.sourceforge.net . You only need the command line version of mp3gain. DjTagger is tested with version 1.4.6. For Windows it can be downloaded here: http://prdownloads.sourceforge.net/mp3gain/mp3gain-dos-1_4_6.zip?download . For linux users: most distributions include an mp3gain package.
After installation, DjTagger needs to know where it can find the mp3gain executable. There are two ways in which you can achieve this:
djtagger.mp3gain.path=C:\\Program Files\\MP3gain\\mp3gain.exe