Skip to content

Cuesheet support #210

Open
Open

Description

@xfzv

If running

% rsgain easy ./dir

where ./dir contains an album in single file with CUESHEET tag format:

% rsgain easy ./dir
[✔] Building directory tree...
[✔] Found 1 directory...
[✔] Scanning directory for files...
[✔] Scanning './file.flac'
[✔] Container: raw FLAC [flac]
[✔] Stream #0: FLAC (Free Lossless Audio Codec), 16 bit, 44,100 Hz, 2 ch
 100% [==================================================================================================================================]

Track: ./file.flac
  Loudness:   -16.27 LUFS
  Peak:     1.000000 (0.00 dB)
  Gain:        -1.73 dB

Album:
  Loudness:   -16.27 LUFS
  Peak:     1.000000 (0.00 dB)
  Gain:        -1.73 dB


Scanning Complete
Time Elapsed:      00:00:23
Files Scanned:     1
Clip Adjustments:  0 (0.0% of files)
Average Loudness:  -16.27 LUFS
Average Gain:      -1.73 dB
Average Peak:      1.000000 (0.00 dB)
Negative Gains:    1 (100.0% of files)
Positive Gains:    0 (0.0% of files)

The file is considered as a single track, i.e. the CUESHEET tag is not taken into account so that each track of the album gets different values for REPLAYGAIN_TRACK_GAIN and REPLAYGAIN_TRACK_PEAK.

As a result, REPLAYGAIN_ALBUM_GAIN / REPLAYGAIN_ALBUM_PEAK / REPLAYGAIN_TRACK_GAIN and REPLAYGAIN_TRACK_PEAK are added to the tags:

% mediainfo ./dir/file.flac | rg -i replay
Album replay gain                        : -1.73 dB
Album replay gain peak                   : 1.000000
Replay gain                              : -1.73 dB
Replay gain peak                         : 1.000000

and share the same values, which is wrong.

In comparison, Foobar2000 handles this - in my opinion - correctly: if opening the same FLAC file in a playlist in Foobar2000, then running the ReplayGain scan (select all tracks, right click > ReplayGain > Scan as a single album) leads to distinct "Track gain" and "Track peak" values for each track of the album. Then, clicking on "Update file tags" will instead write the values to the CUESHEET tag:

REM GENRE "Genre"
PERFORMER "Album Artist"
TITLE "Album name"
REM REPLAYGAIN_ALBUM_GAIN -1.73 dB
REM REPLAYGAIN_ALBUM_PEAK 1.000000
FILE "file.flac" WAVE
  TRACK 01 AUDIO
    TITLE "Title"
    REM REPLAYGAIN_TRACK_GAIN <value> dB
    REM REPLAYGAIN_TRACK_PEAK <value>
    INDEX 01 00:00:00
  TRACK 02 AUDIO
    TITLE "Title"
    REM REPLAYGAIN_TRACK_GAIN <value> dB
    REM REPLAYGAIN_TRACK_PEAK <value>

It would be nice if rsgain could behave similarly when dealing with such albums.

Activity

  1. added
    enhancement
    on Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions