ReplayGain
ReplayGain stores recommended track and album playback gains so supporting players can match listening levels without rewriting the audio.
ReplayGain separates a loudness decision from the stored audio. Analysis supplies recommended gains; metadata stores them; a supporting player decides which gain to apply. The file can retain its original samples while playback becomes more consistent across a collection.
The familiar tags come in two pairs:
| Tag | Meaning |
|---|---|
REPLAYGAIN_TRACK_GAIN |
Recommended gain for this track considered individually |
REPLAYGAIN_ALBUM_GAIN |
Recommended common gain for the album |
REPLAYGAIN_TRACK_PEAK |
Track sample-peak amplitude, conventionally relative to full scale |
REPLAYGAIN_ALBUM_PEAK |
Highest such peak in the album |
Gain is usually represented in decibels, such as -4.20 dB. A peak value such as 0.98 is an amplitude ratio, not −0.98 dB and not a LUFS measurement. Encoded formats can produce decoded peaks beyond 1.0, so “peak” must be interpreted in the signal domain used by the scanner.
Track mode for a mix; album mode for an album
Track mode tries to match each song independently. That suits a shuffled collection where the previous song may come from a completely different recording.
Album mode applies the same gain to every track in the album. This preserves intentional contrasts between movements, interludes and songs. The album measurement is derived from the combined programme; it is not simply the arithmetic average of the individual gain tags.
Imagine an album whose quiet interlude measures −25 LUFS and whose main song measures −17 LUFS. Using an illustrative −18 LUFS reference:
| Playback policy | Interlude gain | Main song gain | Resulting contrast |
|---|---|---|---|
| Individual track matching | +7 dB | −1 dB | Both approach −18 LUFS |
| Common album gain of −2 dB | −2 dB | −2 dB | The original 8 LU difference remains |
The album gain of −2 dB here is supplied for illustration, not derived by averaging those two readings. Their durations and weighted signal energies affect the album analysis. A player may also limit positive gain to accommodate peaks.
The reference convention matters
The original ReplayGain proposal uses a perceptual analysis and a calibrated reference based on its original pink-noise model. The revised specification uses a BS.1770-based loudness measurement with a −18 LUFS reference. Existing collections and scanners do not all use the same generation of analysis.
A stored gain is already the scanner's recommendation. A player must not treat the decibel tag as the track's measured LUFS value and subtract it from a target again. Scanner version and analysis settings explain why rescanning the same collection can change the tags.
The original acoustic calibration is also not a command to set a home system to a particular sound pressure. The listener retains control of the reproduction volume.
What happens at playback
For a gain of −4 dB, the sample multiplier is 10^(−4/20), approximately 0.631. A sample amplitude of 0.5 becomes about 0.315. This is ordinary signal gain, so it changes the PCM values heard by the device even though the file on disk remains unchanged.
A player's preamp setting can add to the tag gain. Peak protection can reduce the total gain further. Consequently, inspecting the tag alone does not establish the final level.
In an Emby comparison, check the behavior of the specific app and route: whether it reads the tags, selects track or album mode, applies a preamp, and changes policy during shuffle. The tags describe an available playback instruction; the selected implementation determines whether that instruction becomes signal processing.