Nemp supports ReplayGain. This adjusts the volume of tracks from different sources so that all tracks are played at the same volume. At least that’s the goal.

Nemp evaluates the ReplayGain information in the metadata. The most common tags are in the format REPLAYGAIN_TRACK_GAIN. There are a few other formats for them, but to my knowledge they are only used sporadically and are therefore not supported by Nemp (so far).

These tags are supported by MP3, Ogg-Vorbis, Flac, M4A and the more exotic formats that use the APEv2 tag for metadata. These values must be calculated in advance, which takes some time

The concept behind ReplayGain

TrackGain. ReplayGain tries to make all titles sound equally loud. The volume of a title is compared with a reference value. The deviation from this reference value indicates to what extent the volume of the title must be increased or decreased during playback so that this reference value is reached. This value is called TrackGain.

AlbumGain. Some albums, however, have titles that are intentionally louder or quieter than other titles on the album. These intentional differences in volume would then be lost. Therefore, not only the volume of the individual tracks is analyzed, but also the average volume of the entire album is considered and the difference to the reference value is determined. This is the AlbumGain value.

Depending on the playlist, either TrackGain or AlbumGain should be used. This can be set in the settings dialog under Player Settings.

Pre-amplification. Depending on the music collection, it makes sense to define a default value for the volume adjustment. Many current albums are mixed very loudly (keyword Loudness-War). Thus the ReplayGain values for these tracks are negative (e.g. -6dB). If a title is played without ReplayGain information, it may appear disturbingly loud. A default value of e.g. -5dB significantly reduces this difference. On the other hand, after using ReplayGain in this example, all titles appear (significantly) quieter than before, which is also not always desired. Therefore an additional default value for title with ReplayGain data can be specified.

These default values disable ReplayGain a bit. Which values make sense depends on your own preferences and on the composition of the music collection.

Clipping and Peaks. If a positive value is set for the preamplification, then it can happen that some samples are amplified beyond the actual maximum. This results in disturbing effects during playback, called clipping. To avoid this, the volume increase can be adjusted so that the peak value of a title is never amplified beyond the maximum. Therefore, when calculating the ReplayGain values, the peak values are also calculated and written into the metadata (as REPLAYGAIN TRACK PEAK, correspondingly also for the album value.

These options can also be changed in the Player Settings.

Clipping and Floating-Point-Channels. By default, Nemp uses floating point channels for playback. These channels also allow internal processing of samples beyond the “actual maximum”. A possible clipping only occurs at the speakers - if at all. Therefore, the Prevent Clipping option does not improve the sound in many cases, but only reduces the volume. However, if you disable the use of floating point channels in the Advanced Player Settings, and then set high values for pre-amplification, you’ll hear the effect of “Prevent Clipping” very clearly.

Calculation of the ReplayGain values

With Nemp these values can also be calculated, if they are not already available. First select some titles in the playlist or media list and then select the item ReplayGain or the desired variant via the context menu (right click).

  • Individual titles. Only TrackGain values are calculated.
  • As one album. In addition to calculating the TrackGain values, the selected tracks are taken as one album. The AlbumGain values are based on the average volume of all selected tracks.
    In order to minimize the number of write accesses to the metadata, the TrackGain values are only written to the metadata when the AlbumGain values are available - i.e. after the last title has been calculated. If the process is aborted before the end, all calculated values will be lost.
  • Multiple albums (by tags). The selected files are interpreted as multiple albums. The automatic compilation of the albums is based on the metadata. If the value for “Album” in the metatags differs (e.g. because the appendix “CD 1/2” is contained), this option should not be selected.
    The ReplayGain values for an album will be written to the metadata when the calculation of all tracks for that album is complete.
  • Delete ReplayGain values. The values will be deleted from the metadata again.

A few hints about that:

  • The audio data itself is not changed. Only up to four data points (track/album gain/peak) are inserted into the metadata of the files. Players that do not support ReplayGain are not affected. Players that support ReplayGain in this form, of course are.
    There is also the variant (at least with mp3 files, see MP3Gain) that the audio data itself is changed (reversibly), so that even with players without ReplayGain support there is an even volume. This method is not used by Nemp.
  • It is absolutely not recommended to calculate the ReplayGain values for the entire media library at once. This is especially true for the multiple albums option, because even with well-maintained collections, the album subdivision is not always 100% correct. And of course this applies even more to the as one album option - applying it to the entire media library (or to large parts of it) is absolutely pointless. Because this way (when using the AlbumGain values) the differences in volume are preserved, which ReplayGain is supposed to prevent.
  • To calculate the AlbumGain value, all titles of the album must have the same sample rate. For example, if one title does not have the usual 44.1kHz, but 48kHz, then the calculation of the AlbumGain value is aborted.
  • During my tests it turned out that Nemp (or the used program library) delivers slightly different values for some files than e.g. foobar2000 or Mp3Gain. The deviations become particularly clear with titles that have both very loud and very quiet passages. However, the tendency is correct, and for titles with strongly fluctuating volume (as a classic I refer to the Bolero) an “average” Volume anyway is a term difficult to define, resp. is such a value there only of very limited expressiveness.

Combination with Mp3Gain

There are generally two methods to achieve a more uniform volume in music tracks.

  • ReplayGain used in Nemp leaves the audio data unchanged, and writes volume adjustment information in the metadata.
  • The also widely used program Mp3Gain can change the audio data, and then writes in the metadata the information how to undo these changes.

Both methods have advantages and disadvantages. ReplayGain works for all audio formats, but Mp3Gain works only for Mp3 files. On the other hand, ReplayGain only works if the metadata is evaluated accordingly by the audio player, Mp3Gain works with every player.

It is important to note that only one of the two methods should be applied to each file or album at a time. Both together can cause undesirable results.