I've seen MP3 rippers that do this kind of normalization. But when they use it to modify the original MP3 file, the have to be careful not to introduce clipping. So they often will have a flag that prevents normalization if the peak amplitude exceeds, say, 95%.

But all of the CD's I've checked already have a peak amplitude of at least 97 percent. Even the ones that are too quiet. CD's are already normalized when you get them. So you can't increase the volume of the source files significantly without clipping the peaks. If you're working on just the source files, the only solution is compression, which is tricky to get right.

A "relative volume" parameter for the playback hardware is a good solution (in fact, it's supported in the ID3v2 tag specification whenever Empeg gets around to implementing that spec), but you'd have to be careful there, too. For example, if you've tuned your system so that 0db on the Empeg is your maximum comfortable listening volume, then a quiet song with a +10 relative volume tag would clip at the player stage. It would be safer to insert negative values into the loud songs than to put positive values into the quiet songs.

Your idea for an algorithm which analyzes the song based on average volume level sounds like a good start, and such a program could be a great starting point for filling out the relative volume field in the ID3v2 tags. Although I think such an algorithm would be a bit more complex than what you describe.

Tony Fabris
Empeg #144
_________________________
Tony Fabris