Jump to content

ReplayGain

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by 63.249.110.34 (talk) at 01:15, 21 June 2009 (→‎Theory). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

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 media players. Although the standard is formally known as "Replay Gain", it is also commonly known as "ReplayGain" or "replaygain." It is sometimes abbreviated "RG".

Theory

Replay Gain works by first performing a psychoacoustic analysis of an entire audio track to measure peak levels and perceived loudness. The difference between the measured perceived loudness and the desired target loudness is calculated; this is considered the ideal replay gain value. (The target loudness of most Replay Gain utilities is unfortunately 89 dB SPL — 6 dB higher than the Replay Gain specification and SMPTE recommendation.[1]) Usually, the gain value and the peak value are then stored as metadata in the audio file, allowing Replay Gain-capable audio players to automatically attenuate or amplify the signal so that tracks will play at a similar loudness level. This avoids the common problem of having to manually adjust volume levels when playing audio files from albums that have been mastered at different levels. Should the audio at its original levels be desired (e.g., for burning back to hard copy), the metadata can simply be ignored.

With lossy files, another benefit of Replay Gain is that the peak information can also be used to prevent loud songs from clipping.[2]

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 in performing Replay Gain calculations.

Replay Gain utilities usually add metadata to the audio files without altering the original audio data. Otherwise, a tool can amplify the data itself and save the result to another, gain-adjusted audio file; this is not perfectly reversible in most cases. The Replay Gain standard specifies an 8-byte field in the header of any file, though 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.

Typical CD players and other legacy audio players do not support Replay Gain.

Track-gain and 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', formerly called 'radio gain') or if they want all albums to sound equally loud with different tracks having different loudness ('album gain', formerly called 'audiophile gain'). In album-gain mode, when album-gain data is missing, players should use track-gain data instead.

Replay Gain-compliant audio players

Replay Gain-compliant portable media players

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.[7] Can directly modify MP3 files.
  • iVolume: Replaces the iTunNORM metadata tag value (optionally on a per-album basis), which is used by iTunes software and iPod music players for Sound Check volume normalization.
  • 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: (open source) generates metadata. Can directly modify original file and write undo information as metadata.[8]
  • Improved MP3Gain: 60% faster due to Hyperthreading and SSE2 Support and other improvements
  • QuuxPlayer for Windows: calculates gain values and saves them in its library database; optionally writes replay gain tags to files with ID3v2 tags.
  • Zortam Mp3 Media Studio: Generates metadata
  • Rapid Evolution: Generates metadata
  • 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

Alternatives

  • Audio normalization: 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.)
  • Audio level compression: 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.

References

  1. ^ Leslie, Rob (24 February 2004). "Replay Gain". mad-dev mailing list. mars.org. Retrieved 2007-03-10. {{cite web}}: Check date values in: |date= (help)
  2. ^ "Replay Gain - Player Requirements - Clipping Prevention".
  3. ^ http://bugs.kde.org/show_bug.cgi?id=81661
  4. ^ http://padoca.wordpress.com/2009/02/15/amarok-21-back-to-the-future-english-version/
  5. ^ Does FLAC.exe decode support ReplayGain? - Hydrogenaudio Forums
  6. ^ modified xmms-mad
  7. ^ Bobulous. "Replay Gain: play music files without volume fluctuations." Retrieved on May 8, 2007.
  8. ^ MP3Gain - Hydrogenaudio Knowledgebase

See also