Replay Gain: Difference between revisions
m (→Linux) |
(merged misplaced paragraph into intro; avoid uncited recommendations; added explanation of metadata pros/cons; +MP3Gain detail; minor copy edits) |
||
Line 1: | Line 1: | ||
'''Replay Gain''' is the name of a technique invented to achieve the same playback volume of audio files. It specifies the reference level of 89dB and an algorithm to measure the '''perceived''' loudness of audio data. | '''Replay Gain''' is the name of a technique invented to achieve the same playback volume of audio files. It specifies the reference level of 89dB and an algorithm to measure the '''perceived''' loudness of audio data. | ||
Replay Gain is different from [[Normalization|peak normalization]]. | Replay Gain allows the loudness of each song within a collection of songs to be consistent. This is called 'Track Gain', or 'Radio Gain' in earlier parlance. It also allows the loudness of a specific sub-collection (an "album") to be consistent with the rest of the collection, while allowing the dynamics from song to song on the album to remain intact. This is called 'Album Gain', or 'Audiophile Gain' in earlier parlance. This is usually important when listening to classical music albums, because quiet tracks need to remain a certain degree quieter than the louder ones. | ||
Replay Gain is different from [[Normalization|peak normalization]]. Peak normalization merely ensures that the peak amplitude reaches a certain level. This does not ensure equal loudness. The Replay Gain technique measures the ''effective power'' of the waveform (i.e. the RMS power after applying an "equal loudness contour"), and then adjusts the amplitude of the waveform accordingly. The result is that Replay Gained waveforms are usually more uniformly amplified then peak-normalized waveforms. | |||
== Implementations == | == Implementations == | ||
There are different Replay Gain implementations, each with its own uses and strength. Most | There are different Replay Gain implementations, each with its own uses and strength. Most use [[metadata]] to indicate the level of the volume change that the player should make. Some modify the audio data itself, and optionally use metadata as well. There are advantages and disadvantages to both methods. | ||
In | In the metadata method, information on both types of Replay Gain (Track Gain and Album Gain) can be stored. The volume-change information can be very precise. If audio data was also changed, the metadata can contain "undo" info. Not all audio players/decoders know how to read and use Replay Gain information stored in metadata. And there's no standard for where and how Replay Gain info is stored; each implementation uses different formats and puts the info in different locations. | ||
In the audio data method, the file's actual audio data is modified so that its natural/default playback volume is at the target level. In this scenario, only one type of Replay Gain (Track Gain or Album Gain) can be applied. If no "undo" info is saved somewhere, it may not be possible to restore the original audio data. Limitations of the audio file format may prevent precise (finely tuned) gain adjustments with this method. For example, MP3 and AAC files can only be losslessly modified in 1.5 dB steps. Depending on the audio file format, the process may also be lossy in the sense that it could irreversibly push a signal above the format's maximum amplitude (resulting in clipping) or below the minimum (resulting in silence). | |||
=== MP3Gain === | === MP3Gain === | ||
[[MP3Gain]] is an implementation of Replay Gain. It | [[MP3Gain]] is an implementation of Replay Gain. It can be used to just analyze files & recommend changes or to also modify the gain. If modifying the gain, it always modifies the audio data. It can also add somewhat precise metadata, including undo info. | ||
* Format: [[MP3]] | * Format: [[MP3]] | ||
* Method: Audio | * Method: Audio + Meta, or Audio only | ||
* Limitations: | * Limitations: Audio data modifications are limited to 1.5dB steps, may become irreversible (however, that's a very rare condition; see the [http://www.hydrogenaudio.org/forums/lofiversion/index.php/t34154.html "mp3gain is NOT lossless" forum thread]) | ||
* http://mp3gain.sourceforge.net/ | * http://mp3gain.sourceforge.net/ | ||
Line 21: | Line 23: | ||
[[AACGain]] is a modified version of MP3Gain that works on both MP3 and AAC files. | [[AACGain]] is a modified version of MP3Gain that works on both MP3 and AAC files. | ||
* Format: [[MP3]], [[AAC]] | * Format: [[MP3]], [[AAC]] (with or without MP4 container) | ||
* Method: Audio | * Method: Audio + Meta, or Audio only | ||
* Limitations: Limited to 1.5dB steps mode, may become irreversible | * Limitations: Limited to 1.5dB steps mode, may become irreversible (same caveat as for MP3Gain) | ||
* http://altosdesign.com/aacgain/ | * http://altosdesign.com/aacgain/ | ||
Revision as of 18:46, 17 September 2009
Replay Gain is the name of a technique invented to achieve the same playback volume of audio files. It specifies the reference level of 89dB and an algorithm to measure the perceived loudness of audio data.
Replay Gain allows the loudness of each song within a collection of songs to be consistent. This is called 'Track Gain', or 'Radio Gain' in earlier parlance. It also allows the loudness of a specific sub-collection (an "album") to be consistent with the rest of the collection, while allowing the dynamics from song to song on the album to remain intact. This is called 'Album Gain', or 'Audiophile Gain' in earlier parlance. This is usually important when listening to classical music albums, because quiet tracks need to remain a certain degree quieter than the louder ones.
Replay Gain is different from peak normalization. Peak normalization merely ensures that the peak amplitude reaches a certain level. This does not ensure equal loudness. The Replay Gain technique measures the effective power of the waveform (i.e. the RMS power after applying an "equal loudness contour"), and then adjusts the amplitude of the waveform accordingly. The result is that Replay Gained waveforms are usually more uniformly amplified then peak-normalized waveforms.
Implementations
There are different Replay Gain implementations, each with its own uses and strength. Most use metadata to indicate the level of the volume change that the player should make. Some modify the audio data itself, and optionally use metadata as well. There are advantages and disadvantages to both methods.
In the metadata method, information on both types of Replay Gain (Track Gain and Album Gain) can be stored. The volume-change information can be very precise. If audio data was also changed, the metadata can contain "undo" info. Not all audio players/decoders know how to read and use Replay Gain information stored in metadata. And there's no standard for where and how Replay Gain info is stored; each implementation uses different formats and puts the info in different locations.
In the audio data method, the file's actual audio data is modified so that its natural/default playback volume is at the target level. In this scenario, only one type of Replay Gain (Track Gain or Album Gain) can be applied. If no "undo" info is saved somewhere, it may not be possible to restore the original audio data. Limitations of the audio file format may prevent precise (finely tuned) gain adjustments with this method. For example, MP3 and AAC files can only be losslessly modified in 1.5 dB steps. Depending on the audio file format, the process may also be lossy in the sense that it could irreversibly push a signal above the format's maximum amplitude (resulting in clipping) or below the minimum (resulting in silence).
MP3Gain
MP3Gain is an implementation of Replay Gain. It can be used to just analyze files & recommend changes or to also modify the gain. If modifying the gain, it always modifies the audio data. It can also add somewhat precise metadata, including undo info.
- Format: MP3
- Method: Audio + Meta, or Audio only
- Limitations: Audio data modifications are limited to 1.5dB steps, may become irreversible (however, that's a very rare condition; see the "mp3gain is NOT lossless" forum thread)
- http://mp3gain.sourceforge.net/
AACGain
AACGain is a modified version of MP3Gain that works on both MP3 and AAC files.
- Format: MP3, AAC (with or without MP4 container)
- Method: Audio + Meta, or Audio only
- Limitations: Limited to 1.5dB steps mode, may become irreversible (same caveat as for MP3Gain)
- http://altosdesign.com/aacgain/
LAME
- Method: Header (mp3infotag)
- Notes:
- Tags added during encoding; not supported by any player yet; Track Gain only
- Replay Gaining MP3's are usually done using MP3Gain (see above) or foobar2000
- http://lame.sourceforge.net/
Musepack Replay Gain
- Method: Header (similar to Meta data method)
- Notes: Replay Gain values are stored in the header and Replay Gain is part of the Musepack specifications; therefore any Musepack decoder that does not support Replay Gain can be considered broken.
- http://www.musepack.net/
VorbisGain
- Format: (Ogg) Vorbis
- Method: Meta (in Vorbis comment)
- http://www.sjeng.org/vorbisgain.html
- new compiles of VorbisGain at www.rarewares.org
- Note: Andavari has provided a very useful script to integrate VorbisGain, which is a CLI tool, into Windows Explorer. Please (Ogg) check this section.
FLAC / METAFLAC
- Format: FLAC
- Method: Meta (in Vorbis comment)
- http://flac.sf.net
WavPack / WVGAIN
- Format: WavPack
- Method: Meta (in APEv2 tag)
- http://www.wavpack.com
Wavegain
- Format: waveform
- Method: Audio
- Limitations: Irreversible
- http://www.rarewares.org/files/others/wavegain.zip
foobar2000 Replay Gain scanner
- Format:
- MP3: Values written to ID3v2 (default) or APEv2 tags.
- Musepack: Values written to header.
- (Ogg) Vorbis: Values written to Vorbis comment.
- WavPack: Values written to APEv2 tags.
- AAC: Values written to APEv2 tags.
- MP4: Uses its own iTunes-compatible tagging system (though iTunes does not support Replay Gain).
- FLAC: Values written to Vorbis comment.
- APE: Values written to APEv2 tags.
- Modules (MOD etc.): Optionally saved into APEv2 tags.
MediaMonkey
- Format:
- In addition to tags, all Replay Gain values are also stored in MediaMonkey's MDB database
- Does not support Album/Audiophile Replay Gain (Added to new MediaMonkey version 3
- Also capable of (irreversibly) changing the volume of MP3 tracks, similar to MP3Gain
- http://www.mediamonkey.com
Winamp Replay Gain scanner
- Format:
- Support Album/Track Gain
Players support
Replay Gain being present in the specs of FLAC, Musepack, and APE formats, any player that support those formats usually support Replay Gain.
The situation with MP3 is rather different, as it was not part of the MP3 specs. The APEv2 tags metadata implementation is somewhat becoming the de-facto standard.
Windows
- foobar2000 supports Replay Gain in all possible aspects.
- Winamp supports Replay Gain in album or track mode.
- MediaMonkey supports track Replay Gain only
- XMPlay recently implemented Replay Gain
...and probably others.
Linux
- For MP3, use the CVS version of the xmms-mad mp3 plugin (it's not yet released as binary, furthermore not available in distribs' versions for now. Meanwhile binaries are available here: custom binaries)
- amarok. By using the amarok-script Replay Gain
- And possibly others, since TagLib added support for APEv2 tags in MP3 files, players using this library (like amaroK and JuK) might support that kind of Replay Gain tags in the near future.
- Quod Libet reads Replay Gain from (Ogg) Vorbis, MP3, FLAC, and Musepack.
- Requires support to be enabled (via the appropriate python bindings and libraries) for the above formats. Does not support Replay Gain values stored in APEv2 tags in MP3s. Replay Gain values are stored in RVA2 id3v2.4 frames. See the Quod Libet RVA2 / Replay Gain notes.
- Music Player Daemon (MPD) reads Replay Gain from (Ogg) Vorbis, FLAC, and Musepack.
- foobar2000-style TXXX frames in MP3s are also supported in the latest development releases.
- MPlayer. Mplayer support for Replay Gain is codec dependent.
- Codecs that are known to support Replay Gain: vorbis
- Because of this, you need to prioritize the codecs that support it, or choose it individually on the command line. To add it to the command line, add an -ac [codec] option after each file that you want to choose the codec for, or at the beginning to make it apply to all files listed. To prioritize the codecs by default, list them in a line in mplayer.conf:
ac=[codec],[othercodec],vorbis,mad,
Portable devices
Rockbox supports Replay Gain (in album or track mode) for most formats, including WMA, MP1/2/3, AAC, ALAC, Musepack, Monkey's Audio, Wavpack, FLAC and Vorbis.
Note that Replay Gain is only supported when using the respective codec's native tagging format. For example: Replay Gain stored in APEv2 tags is not supported for MP3, rather ID3v2.x tags are expected.
There are no other portable players known to support Replay Gain.
The iPod features Soundcheck, which seems to produce roughly the same normalization gains as Replay Gain, but doesn't provide an Album Gain.
Hi-Fi
Slim Devices a company owned by Logitech Inc, supports Replay Gain on both of their hi-end audiophile players, known as the Transporter and the Squeezebox.
External links
- Original Replay Gain website
- Replay Gain at Wikipedia
- Replay Gain using foobar2000 (how to use Replay Gain in Windows using foobar2000).
- Replay Gain in Linux (how to use Replay Gain in Linux using foobar2000 and Wine, or using metaflac or vorbisgain).