17 December, 2012, 11:05:24 PM

Hi All,

First time poster, long time reader. I've been using mp3gain for years, and I basically just want to know if there are any modern equivalents or alternatives to reduce clipping in mp3 files. This is all that I use mp3gain for. I do not use it to make all tracks or albums the same volume. I actually prefer there to be volume differences between songs and albums.

I'm surprised that "clipping" is not a more-discussed issue among all music listeners, not just audiophiles. I have countless examples of songs that, during their regular volume, even at 320 kbps, produce distortion that to my ears is unbearable. Like a fuzzy crackle whenever the levels push through the ceiling. After applying mp3gain to bring below the clipping level, these tracks sound perfect to my ears, and the clipping is totally eliminated. I can't imagine not lowering the gain on most tracks, and I guess that is why I'm surprised that there are not a plethora of programs that try to address it.

Anyway, mp3gain does what I need, which is "apply constant gain". I don't necessarily need track/album gain, target volume, or max-no-clip. I just like to be able to manually reduce tracks by a few decibels to eliminate clipping. Basically, my question is:

- Are there any other programs that do the same thing (i.e. reversible process to apply constant, custom gain reductions without loss in audio quality)? Are there any where the focus is removing clipping rather than equalizing volumes? I guess this is an odd thing to ask since mp3gain serves my purpose, but I can't help but think that this program is old, and support for it has run out. Surely there must be something equivalent that's more current? I've tried many recommended alternatives, but none of them seem to satisfy my needs - they're either way overboard (too many features I don't need), or they are missing key features. I'm also looking for a Mac equivalent, but none of the current Mac mp3gain ports have all of the following:- Reversible- Can analyze for clipping- No loss in audio quality- Can apply custom, constant gain changes to files/albums

I have countless examples of songs that, during their regular volume, even at 320 kbps, produce distortion that to my ears is unbearable. Like a fuzzy crackle whenever the levels push through the ceiling. After applying mp3gain to bring below the clipping level, these tracks sound perfect to my ears, and the clipping is totally eliminated. I can't imagine not lowering the gain on most tracks, and I guess that is why I'm surprised that there are not a plethora of programs that try to address it.

The likely reason there isn't a plethora of programs to address it is because it is essentially a non-issue. What you are experiencing is in all likelihood the result of expectation bias. In keeping with rule #8 in our Terms of Service, to which you agreed upon registering, you are required to substantiate the anecdote I quoted with objective evidence.

While testing this is somewhat tricky because it requires isolating the effects of decoding while maintaining matched levels, it is completely doable.

Please provide 30-second clips of the same piece of audio (one with clipping one without) that has been time-aligned and level matched along with an ABX log indicating you can tell the difference or rescind your claim.

Thank you.

Last Edit: 18 December, 2012, 03:00:21 AM by greynol

Is 24-bit/192kHz good enough for your lo-fi vinyl, or do you need 32/384?

To test whether it's clipping or expectation bias (which we ALL suffer, hence the need for ABX testing and TOS #8 to ensure claims are verifiable on these forums):

- you can decode the original full volume MP3 with clipping causing flattened peaks when there would have been overs then reduce its volume by, say 6.02 dB (6.0 is close enough) in Audacity or similar editor and save as a 16-bit or greater WAV (PCM) at 44100 Hz sampling rate- use mp3gain to apply -6.0 dB gain (which is actually -6.02 dB rounded) so they're matched for loudness and decode that (e.g. open it in Audacity and save it in the same lossless WAV format as the other sample.

Use any ABX tools such as Foobar2000's ABX Comparator or PC-ABX or ABC/HR for Java (which you can use on a Mac) and choose the area to test and the number of trials (e.g. 8 to 10 trials).

I admit I've thought things and written about them on these forums that an ABX before I hit send has shown to be inaudible (in fact one of these was clipping-related - a huge multi-sample clipped over picked up by mp3gain scan at the end of a Rachmaninov symphony, which I tested as above and found to be indistinguishable from the unclipped version amongst the loud crash of percussion and full orchestra. I'd convinced myself of a nasty noise in unblind testing but was unable to tell it from the clean sound or the lossless original scaled to the same reduced loudness once I didn't know which sample I was playing and trying to match with the known versions.)

Some very old presets for encoders such as LAME used to include a --scale switch to reduce the likelihood of decode clipping but ABX has not demonstrated an audible difference even when clipping occurs.

Another unlikely possibility is that your hardware (ADC) is non-linear near full scale, which would be a big surprise in this day and age, and while many high end amps are non-linear with respect to intersample overs (when viewed on an oscilloscope), they are very linear up to full scale and I'm not aware that any of them have ever been ABXed in music reproduction. You could record your soundcard's analogue output (e.g. via a 3.5mm stereo male-to-male cable into another computer) and ABX that against the output of a mp3gain-reduced signal to rule out any hardware problems.

Personally, recognizing that the loudness of a CD relative to another is not intentional artistic choice and that there's no standard loudness, I apply Album Gain to all my music. I do not care about UNDO (and I keep the original lossless anyway so I could re-encode) and I usually apply the Album Gain in foobar2000's Convert... dialogue before it is sent to LAME to be encoded, so that when I scan it, Album Gain is usually very close to 0.00 dB. But feel free to enjoy your music as you like.

It might not be expectation bias. It could be dodgy software/hardware that clips below 0dB FS, or a faulty configuration that's boosting the levels somewhere. It could be dodgy files downloaded from somewhere which have already had a positive gain applied using mp3gain or similar.

I think there's only been one ABX of mp3 encoder+decoder induced clipping on its own, so it can be audible, but not to the extent suggested by the OP.

Did any of you even read my question? I'm not asking about the technical components of clipping, or even where the clipping came from - I honestly don't care, and that's not what I'm trying to track down. I'm asking about alternative software to mp3gain. If this isn't the place to ask for that, then sorry.

Ok, so you've piqued my interest. I followed Dynamic's instructions. I've never used Audacity before, but is "Amplify" the correct way to reduce volume? When I do this, the distortion that I'm observing similarly disappeared from tracks after reducing volume in Audacity. I suppose this partially answers my original question, in that Audacity seems to be able to accomplish the same thing as mp3gain with regards to reducing amplification so that levels don't clip/distort. And just to be clear, this has nothing to do with expectation bias. I'm not an expert in any of this, and it's totally possible that the distortion is a result of poor encoding, poor audio equipment, or whatever else, but I'm certain you'd hear the same thing as me. I can send you a file that demonstrates it clear as day to me, if you want. Wolfmother's "White Unicorn", about 8-9 seconds in, when the bass kicks in, distorts on every lossy version I've ever heard, until the gain is reduced.

The guy is interested in alternative software to mp3gain. What he claims he can, or cannot, hear is merely a by-the-by and somewhat irrelevant.

I respectfully disagree. The OP stated in no uncertain terms that he uses mp3gain and wants an alternative to mp3gain for no other reason than to remove audible clipping. If the clipping has resulted from expectation bias or some other mechanism that has nothing to do with lossy encoding or playback then he has no reason to go down this road.

Last Edit: 18 December, 2012, 03:03:26 PM by greynol

Is 24-bit/192kHz good enough for your lo-fi vinyl, or do you need 32/384?

I can send you a file that demonstrates it clear as day to me, if you want. Wolfmother's "White Unicorn", about 8-9 seconds in, when the bass kicks in, distorts on every lossy version I've ever heard, until the gain is reduced.

A simple ABX test of the lossless version against a lossy version would be an excellent first start which doesn't involve having to use Audacity.

AFAIC, this is precisely the reason why we have TOS8. We need to understand a problem before we start throwing out solutions. If I am to believe what has been said so far, I am inclined to follow 2Bdecided's lead as to what is going on. At this point it doesn't appear to be the result of lossy compression, whether it be on the encoding side or the decoding side.

Last Edit: 18 December, 2012, 02:16:21 PM by greynol

Is 24-bit/192kHz good enough for your lo-fi vinyl, or do you need 32/384?

Since we're apparently so hell-bent on discovering the source of distortion, I think I found it for you - it's the EQ in itunes. When it's off, there's no distortion (even on original lossy files before mp3gain). When I apply the EQ, there is distortion, unless the file has had gain reduced.

Right, I know, itunes sucks, and yes I'm sure I'm a noob and a tool and all these other things for using itunes to listen to music, and I should be ashamed for even coming to these forums.

With that out of the way, let's rephrase the question:"Are there any other programs out there that allow me to reduce the gain/amplification by a specified amount on a large number of files simultaneously, so that I can happily apply the EQ in itunes without hearing any distortion?"

It sounds like you no longer need an alternative to mp3gain having set your sliders lower than 0 dB and discovered via audacity that it wasn't mp3 decode clipping you could hear.

However, in your OP you stated that you wanted UNDO. In that case, I believe only mp3gain saw fit to store UNDO information and implement the UNDO procedure and it's the main one to make it easy to apply Constant Gain rather than Replay Gain to a large collection of files.

I have countless examples of songs that, during their regular volume, even at 320 kbps, produce distortion that to my ears is unbearable. Like a fuzzy crackle whenever the levels push through the ceiling. After applying mp3gain to bring below the clipping level, these tracks sound perfect to my ears, and the clipping is totally eliminated. I can't imagine not lowering the gain on most tracks, and I guess that is why I'm surprised that there are not a plethora of programs that try to address it.

The likely reason there isn't a plethora of programs to address it is because it is essentially a non-issue. What you are experiencing is in all likelihood the result of expectation bias. In keeping with rule #8 in our Terms of Service, to which you agreed upon registering, you are required to substantiate the anecdote I quoted with objective evidence.

While testing this is somewhat tricky because it requires isolating the effects of decoding while maintaining matched levels, it is completely doable.

Please provide 30-second clips of the same piece of audio (one with clipping one without) that has been time-aligned and level matched along with an ABX log indicating you can tell the difference or rescind your claim.

Thank you.

I've seen you say this in the forums before, but I actually did test it today. I had a peculiar file that could only got up to 78db in mp3gain before clipping was supposedly introduced. I my music library set to 93db, but with "no clipping" also ticked. I turned "no clipping" off though and made a copy of the 78db file, which then got processed at 93db. The resulting file clearly showed strong clipping and it pretty damn unpleasant. Then again, that's a 15 db change: I'd be curious to find out what the threshold is, because I've also changed 86db files (maxed out without clipping) to 93db and haven't been able to discern the difference off the top of my head. I suspect the threshold is probably closer to a 3db range (i.e. an 89db file could be safely normalized up to 92db without the clipping being discernible).

I'm curious what guys think, though: I want to play it safe but I also don't like having my music library range between 85db and 93db...kinda defeats the purpose of trying to normalize things with a range like that, and making everything quieter is a pretty lousy compromise (since 60-70% of my library can handle 93db without clipping just fine)

Since we're apparently so hell-bent on discovering the source of distortion, I think I found it for you - it's the EQ in itunes. When it's off, there's no distortion (even on original lossy files before mp3gain). When I apply the EQ, there is distortion, unless the file has had gain reduced.

Right, I know, itunes sucks, and yes I'm sure I'm a noob and a tool and all these other things for using itunes to listen to music, and I should be ashamed for even coming to these forums.

For what its worth, its not that iTunes sucks. Applying positive gain will generally result in clipping unless you add headroom (or are sure the music was mastered with it). When you do that you're basically telling the software to digitally increase the volume, which eventually causes clipping once you get above max.

For what its worth, its not that iTunes sucks. Applying positive gain will generally result in clipping unless you add headroom (or are sure the music was mastered with it). When you do that you're basically telling the software to digitally increase the volume, which eventually causes clipping once you get above max.

True. I'd suggest that the User Interface design is suboptimal for the layperson on most EQs in consumer audio software I've seen.Only a few applications make it clear that because we always operate without digital headroom, that applying positive gain in the digital domain (unlike an analogue HiFi graphic equalizer that the UI depicts) is very likely to cause clipping distortion (any change of peak excursion due to the filtering). A few of the better designs help by letting you make your adjustment then bring all the sliders down equally so the highest is at zero dB (or leave the sliders the same but apply corrective gain).

If there's any clipping remaining due to peak alteration from filtering (which is a similar mechanism to intersample overs) it's very likely to be the very brief overs of the type introduced in lossy encoding and only once ABXed successfully, as 2Bdecided recalled.

Some EQs (like the one in the Sansa clip) automatically drop the overall gain when you move any of the sliders away from zero. That's also quite confusing, but handy. Unfortunately it doesn't seem to drop it sufficiently to always prevent clipping with some of the sliders moved to maximum.

The right way to do it is to design the entire system with sufficient headroom always - but then on anything with a digital output, someone would complain about not being able to get a bit-perfect output, and on the analogue output the SNR might suffer. Running EQ and ReplayGain with sufficient headroom, using a digital-only volume control, and applying gentle limiting when you hit 0dB FS, is appropriate in some devices and, if you've already accepted a digital-only volume control, has no real downside (assuming sufficient processing bitdepth).