Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: mp3gain command line tool revisited (Read 6437 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

mp3gain command line tool revisited

Starting with MP3 image+cue file, I'd like to split that to multiple single-track files and apply a constant album gain of +92 dB.
If, and only if, clipping occurs after applying that gain, the album gain shall be lowered to not clip audio.

Could someone please confirm that the following commands will do the trick?

Code: [Select]
mp3gain /r /d 3.0 /k /s i /w CDimage.mp3
java -jar pcutmp3.jar --cue CDimage.cue --out "%n. %t"

I'd also like to know if pcutmp3 will properly apply the gain value to each track. Or would it be better to do the split first:

Code: [Select]
java -jar pcutmp3.jar --cue CDimage.cue --out "%n. %t"
mp3gain /a /d 3.0 /k /s i /w *.*.mp3

Please note that I'm not a mp3gain guru. As I found no reference to the command line options, I just downloaded the mp3gain tool and ran it to get the usage info:

Code: [Select]
c:\temp\download>mp3gain /?
mp3gain version 1.5.2
copyright(c) 2001-2009 by Glen Sawyer
uses mpglib, which can be found at http://www.mpg123.de
Usage: mp3gain [options] <infile> [<infile 2> ...]
options:
        /v - show version number
        /g <i>  - apply gain i without doing any analysis
        /l 0 <i> - apply gain i to channel 0 (left channel)
                  without doing any analysis (ONLY works for STEREO files,
                  not Joint Stereo)
        /l 1 <i> - apply gain i to channel 1 (right channel)
        /e - skip Album analysis, even if multiple files listed
        /r - apply Track gain automatically (all files set to equal loudness)
        /k - automatically lower Track/Album gain to not clip audio
        /a - apply Album gain automatically (files are all from the same
                      album: a single gain change is applied to all files, so
                      their loudness relative to each other remains unchanged,
                      but the average album loudness is normalized)
        /m <i> - modify suggested MP3 gain by integer i
        /d <n> - modify suggested dB gain by floating-point n
        /c - ignore clipping warning when applying gain
        /o - output is a database-friendly tab-delimited list
        /t - writes modified data to temp file, then deletes original
             instead of modifying bytes in original file
        /q - Quiet mode: no status messages
        /p - Preserve original file timestamp
        /x - Only find max. amplitude of file
        /f - Assume input file is an MPEG 2 Layer III file
             (i.e. don't check for mis-named Layer I or Layer II files)
        /? or /h - show this message
        /s c - only check stored tag info (no other processing)
        /s d - delete stored tag info (no other processing)
        /s s - skip (ignore) stored tag info (do not read or write tags)
        /s r - force re-calculation (do not read tag info)
        /s i - use ID3v2 tag for MP3 gain info
        /s a - use APE tag for MP3 gain info (default)
        /u - undo changes made (based on stored tag info)
        /w - "wrap" gain change if gain+change > 255 or gain+change < 0
              (use "/? wrap" switch for a complete explanation)
If you specify /r and /a, only the second one will work
If you do not specify /c, the program will stop and ask before
     applying gain change to a file that might clip

Edit: Corrected the gain value given with -d from 92.0 to 3.0

mp3gain command line tool revisited

Reply #1
I would think that you must split the file first for it to determine track level ReplayGain values. I see no indication that mp3gain is capable of working with disc images and CUE sheets.

Try the second method and see what you end up with. A tag editor like Mp3tag will let you examine the ID3v2 tag (if mp3gain successfully writes the values to the ID3v2 tag, per the /s i option) and see the RG values written to each file.

mp3gain command line tool revisited

Reply #2
mp3gain only works on the mp3 image file and doesn't even bother with the cue file. My understanding is, that the main difference between track and album gain is that the former considers the loudest frame in each track, on a track by track basis, while the latter looks for the loudest frame in all tracks. If all tracks are concatenated in an image file, there's no difference between track and album gain, as there's basically only one track from a technical perspective, right? Or am I completely off here?