ReplayGain is a standard for storing loudness metadata in audio files so that a player can normalize volume across tracks or albums without permanently altering the files. Gramophone implements full ReplayGain 2.0 support.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/foedusprogramme/gramophone/llms.txt
Use this file to discover all available pages before exploring further.
Why ReplayGain matters
Different albums and tracks are mastered at different loudness levels. Without normalization, you may need to adjust the volume every time you switch between an old vinyl rip and a modern pop track. ReplayGain solves this by letting the player apply a calculated gain offset based on metadata stored in the file.Gain modes
Gramophone supports three modes, configurable under Settings > Audio > ReplayGain:| Mode | Behavior |
|---|---|
| None | ReplayGain is disabled. No gain adjustment is applied. |
| Track | Normalizes each track independently to a consistent loudness. Recommended for shuffle playback. |
| Album | Normalizes at the album level, preserving the relative loudness differences between tracks within an album. Recommended for listening to albums from start to finish. |
Supported metadata tags
Gramophone reads ReplayGain information from a wide range of tag formats and conventions:ID3 tags (MP3, AAC, etc.)
ID3 tags (MP3, AAC, etc.)
Vorbis comments (FLAC, OGG, Opus)
Vorbis comments (FLAC, OGG, Opus)
REPLAYGAIN_TRACK_GAIN,REPLAYGAIN_ALBUM_GAINREPLAYGAIN_TRACK_PEAK,REPLAYGAIN_ALBUM_PEAKR128_TRACK_GAIN,R128_ALBUM_GAIN(OGG Opus standard)- JRiver tags:
REPLAY GAIN,PEAK LEVEL
MP4 internal frames
MP4 internal frames
com.apple.iTunesdomain frames:REPLAYGAIN_TRACK_GAIN,REPLAYGAIN_ALBUM_GAIN, and relatediTunNORMinternal frame (iTunes SoundCheck for MP4)
Additional gain controls
Beyond the mode selection, Gramophone provides two extra gain parameters:| Setting | Description |
|---|---|
| Pre-amp (boost gain) | Adds a fixed dB offset on top of the ReplayGain value. Useful if your files were tagged to a loudness target that is too quiet for your listening environment. |
| Reduce gain | Prevents clipping by capping the applied gain so that the loudest peak in the track does not exceed digital full scale. |
Adaptive Dynamic Range Compression (ADRC)
When the applied gain would cause the signal to clip (i.e. when ReplayGain pushes the peak above 0 dBFS and Reduce gain is not sufficient to prevent it), Gramophone can invoke Adaptive Dynamic Range Compression via thehificore native module. ADRC applies a soft knee compressor that brings transients under control rather than hard-clipping or reducing gain aggressively.
The compressor uses the following parameters internally:
| Parameter | Value |
|---|---|
| Compression ratio | 2:1 |
| Attack time constant (τ) | 1.4 ms |
| Release time constant (τ) | 93 ms |
Integration with ExoPlayer
ReplayGainAudioProcessor is implemented as a BaseAudioProcessor and is inserted into ExoPlayer’s audio processing chain. It receives PCM audio frames and applies the gain multiplier (or passes them through ADRC) before they reach the audio output. The processor updates its parameters in real time as settings change or as new tracks begin — no restart is required.