ReplayGain

From HandWiki
Short description: Loudness normalization system

ReplayGain is a proposed technical standard published by David Robinson in 2001 to measure and normalize the perceived loudness of audio in computer audio formats such as MP3 and Ogg Vorbis. It allows media players to normalize loudness for individual tracks or albums. This avoids the common problem of having to manually adjust volume levels between tracks when playing audio files from albums that have been mastered at different loudness levels.

Although this de facto standard is now formally known as ReplayGain,[1] it was originally known as Replay Gain and is sometimes abbreviated RG.

ReplayGain is supported in a large number of media software and portable devices.

Operation

ReplayGain works by first performing a psychoacoustic analysis of an entire audio track or album to measure peak level and perceived loudness. Equal-loudness contours are used to compensate for frequency effects and statistical analysis is used to accommodate for effects related to time. The difference between the measured perceived loudness and the desired target loudness is calculated; this is considered the ideal replay gain value. Typically, the replay gain and peak level values are then stored as metadata in the audio file. ReplayGain-capable audio players use the replay gain metadata to automatically attenuate or amplify the signal on a per-track or per-album basis such that tracks or albums play at a similar loudness level. The peak level metadata can be used to prevent gain adjustments from inducing clipping in the playback device.[2]

Metadata

The original ReplayGain proposal specified an 8-byte field in the header of any file. Most implementations now use tags for ReplayGain information. FLAC and Ogg Vorbis use the REPLAYGAIN_* Vorbis comment fields. MP3 files usually use ID3v2. Other formats such as AAC and WMA use their native tag formats with a specially formatted tag entry listing the track's replay gain and peak loudness.

ReplayGain utilities usually add metadata to the audio files without altering the original audio data. Alternatively, a tool can amplify or attenuate the data itself and save the result to another, gain-adjusted audio file; this is not perfectly reversible in most cases. Some lossy audio formats, such as MP3, are structured in a way that they encode the volume of each compressed frame in a stream, and tools such as MP3Gain take advantage of this for directly applying the gain adjustment to MP3 files, adding undo information so that the process is reversible.

Target loudness

The target loudness is specified as the loudness of a stereo pink noise signal played back at 89 dB sound pressure level or −14 dB relative to full scale.[3] This is based on SMPTE recommendation RP 200:2002, which specifies a similar method for calibrating playback levels in movie theaters using a reference level 6 dB lower (83 dB SPL, −20 dBFS).[note 1]

Track-gain and album-gain

ReplayGain analysis can be performed on individual tracks, so that all tracks will be of equal volume on playback. Analysis can also be performed on a per-album basis. In album-gain analysis an additional peak-value and gain-value, which will be shared by the whole album, is calculated. Using the album-gain values during playback will preserve the volume differences among tracks on an album.

On playback, listeners may decide if they want all tracks to sound equally loud or if they want all albums to sound equally loud with different tracks having different loudness. In album-gain mode, when album-gain data is missing, players should use track-gain data instead.

Alternatives

  • Peak amplitude is not a reliable indicator of loudness, so consequently peak normalization does not offer reliable normalization of perceived loudness. RMS normalization is more accurate, but does not take into account psychoacoustic aspects of loudness perception.
  • With dynamic range compression, volume may be altered on-the-fly on playback producing a variable-gain normalization, as opposed to the constant gain as rendered by ReplayGain. While dynamic range compression is beneficial in keeping volume constant, it changes the artistic intent of the recording.
  • Sound Check is a proprietary Apple Inc. technology similar in function to ReplayGain. It is available in iTunes and on the iPod.[5]
  • Standard measurement algorithms for broadcast loudness monitoring applications have recently been developed by the International Telecommunication Union (ITU-R BS.1770) and the European Broadcasting Union (EBU R128).[6] This new method has been used to measure loudness in newer ReplayGain utilities such as foobar2000 (since 1.1.6)[lower-alpha 1] and loudgain.[lower-alpha 2]

Implementations

Name Platforms Can write Ref.
AIMP Template:Csl Yes [lower-alpha 5]
Amarok Template:Csl Yes [lower-alpha 6]
Audacious Template:Csl No [lower-alpha 7]
Banshee Template:Csl Yes [lower-alpha 8]
beaTunes Template:Csl Yes [lower-alpha 9]
BTR Amp Template:Csl No [lower-alpha 10]
Clementine Template:Csl No
cmus Unix-like Yes
DeaDBeeF Template:Csl Yes [lower-alpha 11]
Exaile Template:Csl No
Ex Falso/Quod Libet Template:Csl Yes [lower-alpha 12]
foobar2000 Template:Csl Yes [lower-alpha 1]
JRiver Media Center Template:Csl Yes [lower-alpha 13]
JavaTunes Template:Csl No
Kodi Template:Csl No
Lightweight Music Server Template:Csl Yes [lower-alpha 14]
Logitech Media Server Template:Csl Yes
Loudgain Template:Csl Yes [lower-alpha 2]
MAD/madplay Template:Csl Yes
MediaMonkey Template:Csl Yes
Mixxx[note 2] Template:Csl Yes [lower-alpha 15]
mp3gain Template:Csl Yes [lower-alpha 16]
mpg123 Template:Csl No
MPD Template:Csl Yes
mpv Template:Csl No
Muine Template:Csl No [lower-alpha 17]
MusicBee Template:Csl No
Nightingale Template:Csl No [lower-alpha 18]
PowerAMP Template:Csl No
ProppFrexx ONAIR Template:Csl Yes [lower-alpha 19]
RadioBOSS Template:Csl Yes
Rockbox Template:Csl Yes
SoX Template:Csl Yes
Vanilla Music Template:Csl No
Vinyl Music Player Template:Csl No
VLC media player Template:Csl No
Winamp Template:Csl Yes
XMPlay Template:Csl Yes
Zortam Mp3 Media Studio Template:Csl Maybe[note 3]

Streaming

See also

Notes

  1. Although the original ReplayGain proposal used the 83 dB SPL reference level unchanged, an early departure from the proposal to 89 dB SPL was endorsed by its author.[4]
  2. Uses MAD.
  3. Exclusive to the Pro version on Windows.

References

Media player features pages

  1. 1.0 1.1 Foobar2000:Preferences:ReplayGain Scanner – Hydrogenaudio Knowledgebase, https://wiki.hydrogenaud.io/index.php?title=Foobar2000:Preferences:ReplayGain_Scanner 
  2. 2.0 2.1 Hormann, Matthias C. (2024-01-04), loudgain, https://github.com/Moonbase59/loudgain, retrieved 2024-01-21 
  3. Main features and Functions, https://www.aimp.ru/?do=features, retrieved 2023-02-25 
  4. Main features and functionality, https://www.aimp.ru/?do=features&os=android 
  5. [lower-alpha 3][lower-alpha 4]
  6. Amarok 2.1 – back to the future, Padoca, 2009-02-15, http://padoca.wordpress.com/2009/02/15/amarok-21-back-to-the-future-english-version/, retrieved 2010-12-30 
  7. Lindgren, John, "Replay Gain in Audacious", Audacious Forums, https://redmine.audacious-media-player.org/boards/1/topics/846?r=848, retrieved 2023-08-29, "You have to use a program like mp3gain to analyze the file beforehand." 
  8. YeOldeChangeLog, https://gitlab.gnome.org/Archive/banshee/-/raw/master/extras/YeOldeChangeLog 
  9. (in en) beaTunes, https://www.beatunes.com/en/itunes-replay-gain.html, retrieved 2023-08-29, "beaTunes allows you to perform the ReplayGain analysis and adjust the standardized, track-specific id3 tags" 
  10. BTR AMP v13.0 – Volume Normalization – ReplayGain and Sound Check, 2022-04-07, https://btrlabs.com/btr-amp-v13-volume-normalization-replaygain-and-sound-check/, retrieved 2023-04-06 
  11. DeaDBeeF – The Ultimate Music Player, https://deadbeef.sourceforge.io/, retrieved 2023-04-06 
  12. Replay Gain, https://quodlibet.readthedocs.io/en/latest/guide/playback/replaygain.html, retrieved 2023-04-06 
  13. Replay Gain Adjustment, https://wiki.jriver.com/index.php/Replay_Gain_Adjustment, retrieved 2023-04-06 
  14. Poupon, Emeric, "Web player: Replaygain support" (in en), lms issues (38), https://github.com/epoupon/lms/issues/38, retrieved 2024-01-21 
  15. Features, https://mixxx.org/features/, retrieved 2023-04-07, "Mixxx reads existing ReplayGain tags and analyzes songs that don't have them." 
  16. MP3Gain, https://mp3gain.sourceforge.net/, retrieved 2023-04-07, "MP3Gain analyzes and adjusts mp3 files so that they have the same volume." 
  17. updated TODO again, making the direction we're heading a bit clearer, 2004-02-13, https://gitlab.gnome.org/Archive/muine/-/commit/da6bec783172a84084857455aa96f8f8f492fffb 
  18. Giger, Martin, "Normalization?", Nightingale Forum, https://forum.getnightingale.com/thread-864.html, retrieved 2023-05-31, "there is no reference of it being loaded or written to the file" 
  19. "Features", Qmmp, https://qmmp.ylsoftware.com/features.php, retrieved 2023-06-01, "ReplayGain scanner" 

External links