I've noticed that when encoding with lame and playing back using madplay (-a 0 with -G), the gain values don't always add up properly. Also, on quiet samples such as halfsweep, lame with clipdetect says that with a gain of +21 it's at least 10dB from full scale, but when played back with mad (only +15dB for mad default of 83 reference level) results in a high volume and heavy clipping with a peak of > +5dB. Is this a problem with LAME or with MAD?

[Edit] Seems I misinterpreted the information. Guess clip detection is not meant for checking playback with the tagged RG level, but simply for checking if clipping is introduced when decoding as is. BTW is there a way to disable writing the RG gain into the header? [/Edit]