Flaw in ReplayGain spec
Flaw in ReplayGain spec
May 12 2002, 11:04
Joined: 24-September 01
Member No.: 13
It occured to me today that there is a problem with the current ReplayGain spec, or rather, my proposal for doing it in Vorbis.
The issue is combining replaygain and clipping prevention.
If applying the replaygain would cause the track to clip, clipping prevention kicks in, and reduces the level. This will make the output loudness different from the ideal, 'equal' level.
When running in radio/track mode, there is no way around this, since you don't know in advance what you are going to encounter. The best you can do is set the default level low enough so you can hope it'll never happen. I believe this was the idea (among possibly other things) behind setting the default level to K-20 in the new MPC decoders? (Frank? )
If the implementation in the current Vorbis players is correct, a similar effect can be reached by setting the preamp in the plugin to -6dB or so.
In album gain, you could avoid this from happening for the entire album you're listening to, since you already ReplayGain-processed them in group and thus know what is coming up, however, my current proposal poses problems for doing this: You would need to read in all files that belong to the album, read in the peak values, and remember the largest, and use that as the peak value for the individual tracks.
This is what I originally envisioned, however, looking back, this is both ugly, cumbersome and it may not even be possible in some player/plugin architectures.
I think the correct solution would probably be to store an album-peak value.
It would be trivial to implement in the ReplayGain tools, and require only minimal changes in the players without all the uglyness the current method would require (which isn't done correctly by anyone anyway).
The disadvantage is that it requires another tag. However, since the Vorbis people seem to have gotten a bit more enthousiastic about ReplayGain lately, perhaps that isn't so much of a problem.
I believe it's valuable to do this, as it may post a real problem in practise. Moreover, the proposal as it is now is broken by design in this regard, and I'd prefer to fix it while it's still fixable.
Also, the ReplayGain proposal on David's site doesn't mention anything about this? Is there another way to address this problem?
There's two other issues with the current spec that I'd like to discuss about while it's still possible.
1) Change RG_* into REPLAYGAIN_*
This was proposed by Segher, with the idea that someone looking at the tags and that doesn't know what they are can at least google to find out, whereas you'd be left clueless with the current 'RG'. I think this idea is valuable and good.
2) Source/version tag
I didn't include one originally because I saw no way to keep it consistent if you allow the user to edit the tags (you can't require them to know the spec...), and because I didn't see the RG calculations being improved for quite a while. Unfortunately, Frank Klemm has already proven me wrong on the latter. I don't see a way to make such a tag actually _work_ though.
I'd like feedback from everyone about all of this. Is it worthwhile to change the current proposal and fix some of the above issues?
May 20 2002, 09:52
Joined: 10-January 02
Member No.: 973
Originally posted by Garf
So, if anyone has an interest in keeping using the current Vorbis ReplayGain, the current suggested format looks like:
OK, I've mostly changed VorbisGain now, including a way to convert the old format to the new (haven't tested it yet though, so it isn't ready for release). But there's one thing I've been thinking about (and that has been mentioned in this discussion): Change the "gain" to "level" or something. I.e., don't store the relative gain, but the absolute volume level.
The reason is that you may want different "target levels" in different situations (e.g., use the "standard" 83 dB when playing on your home computer with a 24-bit soundcard, but 89 dB when using a portable player). And it wasn't without a reason that Snelg decided for 89 dB as the default for MP3Gain...
Besides, the peaks describe a property of the file. Level would do the same. (And do you really need the "REPLAYGAIN_" prefix then? )
Anyway, after thinking a bit about it, it seems like the right thing to do. The --target-level option doesn't really belong in VorbisGain IMHO; the player is a better place (the fact that the Vorbis Winamp plugin already has a pre-amp option speaks in favour of that, I'd say).
|Lo-Fi Version||Time is now: 4th March 2015 - 13:36|