Replay Gain
From Wikipedia, the free encyclopedia
Replay Gain is a proposed standard published in 2001 to normalize the perceived loudness of computer audio formats such as MP3 and Ogg Vorbis. It works on a track/album basis, and is now supported in a growing number of players. Although the standard is formally known as "Replay Gain," it is also commonly known as "ReplayGain" or "replaygain." It is sometimes abbreviated "RG."
Contents |
[edit] Basics
Replay Gain works by first performing a psychoacoustic analysis scan of the entire audio file to measure the perceived loudness and peak levels. The difference between the loudness and the target loudness (usually 89 dB SPL[1]) is calculated; this is the gain value. Typically, the gain value and the peak value are then stored in the audio file as metadata, allowing Replay Gain–compliant audio players to automatically attenuate (or in some cases amplify) the output so that such files will play back at similar loudness to one another. This avoids the common problem of having to manually adjust volume levels when playing audio files from different albums that have been mastered at different levels. Another benefit of Replay Gain scanning is that the peak information can also be used to prevent loud songs from clipping.
Replay Gain implementations usually involve adding metadata to the audio without altering the original audio data. While the Replay Gain standard specifies an 8-byte field in the header of any file, many popular audio formats use tags for Replay Gain information. FLAC and Ogg Vorbis use the REPLAYGAIN_*
comment fields. MP3 files usually use ID3v2 or APEv2 tags.
Legacy audio players do not support Replay Gain metadata. An alternate way of implementing gain correction that supports such players is to directly modify the volume of the scanned file or to create a new copy of the file with the volume modified. In the latter case, the process may not be perfectly reversible.
[edit] Track gain vs. Album gain
Replay Gain 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, will be calculated. Using the album gain values will preserve the volume differences within an album.
On playback, assuming the metadata method is used, listeners may decide if they want all tracks to sound equally loud (track gain) or if they want all albums to sound equally loud (album gain).
Track gain and album gain were previously known as radio gain and audiophile gain, respectively.
[edit] Replay Gain–compliant audio players
- Amarok for Linux (using the ReplayGain script)
- flac: The reference FLAC decoder can create a new copy with Replay Gain applied, through the undocumented option --apply-replaygain-which-is-not-lossless as of version 1.1.1
- foobar2000 for Windows
- J.River Media Center for Windows
- MediaMonkey for Windows
- madplay
- mpd for Unix-like systems (supports Replay Gain for Vorbis and FLAC, but not for MP3)
- Muine music player for GNOME
- Quod Libet
- Rhythmbox for GNOME
- Rockbox firmware for various digital audio players
- Squeezebox2 (and 3) and SlimServer 6.2 from Slim Devices
- Winamp for Windows
- Xbox Media Center for the Xbox
- XMMS for Unix-like systems with X11 (supports Replay Gain for Vorbis; for MP3 files, a patched version of the xmms-mad plugin[2] which only supports APEv2 is available.)
- XMMS2
- XMPlay for Windows
[edit] Implementations of Replay Gain scanners
- AACGain: Directly modifies original file and writes undo information as metadata.
- flac and metaflac: Encoder can optionally generate metadata. Tagger generates metadata.
- foobar2000: Generates metadata through included plugin for all supported tag formats. Can directly modify MP3 files.
- iVolume: Replaces the
iTunNORM
metadata tag value (optionally on a per-album basis), which is used by iTunes and iPods for Sound Check volume normalization. OS X only. - LAME: Encoder writes metadata to LAME tag
- MediaMonkey: Analyze Volume calculates RG values and writes them into the files as tags and into its library database
- MP3Gain: Generates metadata. Can directly modify original file and write undo information as metadata. [3]
- replaygain.exe: Generates metadata which is stored in the file header of Musepack files.
- VorbisGain: Generates metadata.
- WaveGain: Generates a new copy with Replay Gain applied.
- Winamp: Generates metadata
[edit] 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 a little more accurate, but care must be taken not to introduce clipping, either by guaranteeing appropriate headroom or by using hard or soft limiting. (Replay Gain itself is an elaboration on RMS normalization.)
- With audio level compression, volume may be altered on the fly on playback, but the dynamic range will be compressed. Although this is beneficial in keeping volume constant at all times, it is not always desirable.