bug-gnupod
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-gnupod] Patch to support ReplayGain / mp3gain


From: Richard van den Berg
Subject: Re: [Bug-gnupod] Patch to support ReplayGain / mp3gain
Date: Fri, 08 May 2009 16:16:45 +0200
User-agent: Thunderbird 2.0.0.21 (Macintosh/20090302)

On 5/8/09 2:26 PM, H. Langos wrote:
Could you send me a sample of an iTunes generated RVA2 tag?

Sure. I'll fire up iTunes later and send it to you privately.

Yeap. And if mp3gain can't be changed to do write RVA2 tags by itself, maybe there is a way to make mp3gain only do the analysis and pass its result to a programm that can write those RVA2 tags?

That would be possible using:

$ mp3gain -o -q -s s foo.mp3
File MP3 gain dB gain Max Amplitude Max global_gain Min global_gain
foo.mp3    -7    -10.500000    38780.534185    255    145
"Album"    -7    -10.500000    38780.534185    255    145

Do you know if the author of mp3gain is still active? reachable? alife?

I have no clue.. in the thread from 2004 they mention he was unresponsive.

So how do we get mp3gain's analysis results into RVA2 / XRVA tags?

By changing the mp3gain C code. It's open source after all. I just don't have the stomach or time for it at the moment. Perhaps using the tagging code from normalize will make it easier. However, there could be a good reason not to attempt it. From http://jwz.livejournal.com/370342.html?thread=4232358#t4232358

Anway, whats not clear to me is if the RVA2 value could be used with ReplayGain. Both ReplayGain and RVA2 are applied as a constant value across the complete track, but I'm not sure the units are the same as the RVA2 tag.

Are you sure about the non desctructivnes of mp3gain?

You can run mp3gain in several modes, either (often reversible) changing the volume of the file or just tagging it. I use it only for tagging. From the Debian man page:

mp3gain actually changes your file’s gain only when you use one of the options -r, -a, -g, or -l. If none of these options is given, only a
      tag denoting the recommended gain change is written to the file.


If you've got a strong stomach you might want to read the whole thread: http://jwz.livejournal.com/370342.html

Great read, thanks.

If this is all true, than your patch for gnupod is in vain as the volume of those files was already changed by mp3gain. Reading the APE tag and acting on the information would either double the adjustment or cancel it out, depending on wether mp3gain stores the information on what it did, or how to undo its action.

Interesting question. Since I only tag my mp3s, and never let anything change the audio frames, I'm safe no matter what.

The following shows others are too. The ReplayGain APE tags always contain the dB change needed to get the volume to the reference level. When mp3gain has altered the file, the RG APE tags will be close(r) to 0. It will also store undo information in the MP3GAIN_UNDO APE tag.

$ cp -p org.mp3 cleaned.mp3
$ mp3gain -s d cleaned.mp3
$ mp3gain -s c cleaned.mp3
cleaned.mp3

$ cp -p cleaned.mp3 altered.mp3
$ mp3gain -r altered.mp3
altered.mp3
Applying mp3 gain change of -7 to altered.mp3...

$ mp3gain -s c altered.mp3
altered.mp3
Recommended "Track" dB change: 0.035000
Recommended "Track" mp3 gain change: 0
Max PCM sample at current gain: 11529.519104
Max mp3 global gain field: 248
Min mp3 global gain field: 138

$ mp3gain tagged.mp3
tagged.mp3
Recommended "Track" dB change: -10.500000 Recommended "Track" mp3 gain change: -7
Max PCM sample at current gain: 38780.534185
Max mp3 global gain field: 255
Min mp3 global gain field: 145


Recommended "Album" dB change for all files: -10.500000
Recommended "Album" mp3 gain change for all files: -7

$ cp -p cleaned.mp3 tagged.mp3

$ mp3gain -s c tagged.mp3
tagged.mp3
Recommended "Track" dB change: -10.500000
Recommended "Track" mp3 gain change: -7
Max PCM sample at current gain: 38780.534784
Max mp3 global gain field: 255
Min mp3 global gain field: 145

$ cp -p altered.mp3 undo.mp3
$ mp3gain -u undo.mp3
Undoing mp3gain changes (7,7) to undo.mp3...

$ mp3gain -s d undo.mp3
$ cmp -l cleaned.mp3 undo.mp3
$

Cheers,

Richard




reply via email to

[Prev in Thread] Current Thread [Next in Thread]