Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Encoder Clipping (Read 3078 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Encoder Clipping

Hello everyone!
I'm new to the place, so please excuse me for the lengthy introduction, I just wanna preface this  :P
I got a new pair of decent bookshelf speakers after a lifetime of PC speakers, and thus I can now definitely discern the difference between good and bad audio quality. On PC speakers, it was either bad, or really bad  :P

Anyways, I'm currently ripping some of my older CDs and I have to mention here that I wouldn't call myself an audiophile.
If I had infinite hard drive space, sure, I'd rip everything to FLAC and be done with all this, but I don't have infinite space, so for now I still value convenience over total accuracy. With my current setup (and my current ears), I can't tell the difference between high quality MP3s/AACs/OGGs and FLAC to be honest with you. Some of the albums I really I keep on FLAC, and everything else I do LAME V0.

Now, here comes the interesting part. When I rip an album to FLAC (or any other lossless encoder anyway), everything's looking fine and dandy in Audacity.
If I rip the same album using LAME (or any other lossy encoder), Audacity shows a lot of clipping.
So I wanted to ask. As a non-audiophile, (but also as person who doesn't want to listen to broken audio), is this something that I should care about? Is it just Audacity that displays it so ominously? Or is it actual, audible clipping? Do losssy encoders simply behave like that? Do I have to do something to avoid this from now, or do I just leave everything as it is?

I realize this must have been discussed in length here before, but searching the ol' archives is pretty nasty, I didn't even know how to look up this specific matter, so I apologize if this is the millionth time this is being explained here.

Thank you for any help!

Re: Encoder Clipping

Reply #1
I can't offer an answer as to why but I've noticed this too. I found several albums that had clipping in the encoded file, although they were all relatively recent albums that suffer from "loudness" issues and not older ones. I thought, at first, that it was down to over-compression but on listening to the unencoded tracks I found the same as you have. Little or no clipping, certainly not audible-level problems anyway.

My solution was to reduce the volume a couple of dB (in the WAV or FLAC copy) using audacity's "normalize" function, this removed the clipping entirely when re-encoded. Worth a try to see if that's your issue too. If the peaks are showing at or very close to 0dB in the unencoded track, chances are you'll solve it that way. I only had a relatively few tracks to sort out so I did them manually - if you have a lot to do you may want to find a way to automate it.

EDIT: clarifications

Re: Encoder Clipping

Reply #2
Thank you for your reply!
Sure, I had thought of that.

But firstly, yes I have a big collection to manage, not just a few tracks, so that sounds like a nightmare!
But secondly, and most importantly, I'd rather not "destructively" fiddle with something that experts have crafted.
Now, I know ReplayGain exists, which, as I understand, is a non-destructive way to do exactly what you did manually in Audacity.
But I don't know how to make use of it in this situation.

Re: Encoder Clipping

Reply #3
Thank you for your reply!
Sure, I had thought of that.

But firstly, yes I have a big collection to manage, not just a few tracks, so that sounds like a nightmare!
But secondly, and most importantly, I'd rather not "destructively" fiddle with something that experts have crafted.
Now, I know ReplayGain exists, which, as I understand, is a non-destructive way to do exactly what you did manually in Audacity.
But I don't know how to make use of it in this situation.
Knocking a dB or two off the levels isn't "fiddling with something that experts have crafted", with all due respect. After all, do you adjust the level on the volume control when listening? That is the same thing.

You can also alter a copy of the file, not the original (which would be bad practice anyway). Granted, you'll lose a tiny bit of dynamic range by reducing the levels but it's too small to worry about - especially compared to the information losses of a lossy compressor.

I'm sure someone more knowledgeable will be along to tell you how to automate this or to provide a better solution. As I said, I never had the need to do so.

 

Re: Encoder Clipping

Reply #4
If you batch convert using foobar2000 you can knock the amplitude down a few dB using its "preamp" function. Audacity can do the same thing with macros (which I think it calls something else).


Re: Encoder Clipping

Reply #6
Quote
Now, here comes the interesting part. When I rip an album to FLAC (or any other lossless encoder anyway), everything's looking fine and dandy in Audacity.
If I rip the same album using LAME (or any other lossy encoder), Audacity shows a lot of clipping.
As you know MP3 is lossy but it's not simply "throwing away data".   The wave shape changes.  Some peaks get higher and some peaks get lower.    MP3 can go over 0dB without clipping so the MP3 isn't actually clipped.   MP3 also adds a few milliseconds of silence to the beginning and end of the file.

Audacity is showing potential clipping where the level goes over 0dB.   Also, if you have a file that's truly clipped you can reduce the level by one dB and of course that doesn't remove the clipping but Audacity won't show any clipping.

If the MP3 goes over 0dB and you play the file at "full digital volume" you will clip your DAC (digital-to-analog converter) or if you convert to regular (integer) WAV, the WAV will be clipped at 0dB.  

Some people reduce the level by 1 or 2 dB before making MP3s but I've never hear of a case where that slight clipping was audible.   That is, I've never heard of a situation where there were MP3 compression artifacts and reducing the volume made the MP3 encoding transparent in an ABX test.  (And I don't know if anybody has done such a test.)

Re: Encoder Clipping

Reply #7
Or, you could use mp3 gain on the encoded files. https://sourceforge.net/projects/mp3gain/files/
As you know MP3 is lossy but it's not simply "throwing away data".   The wave shape changes.  Some peaks get higher and some peaks get lower.    MP3 can go over 0dB without clipping so the MP3 isn't actually clipped.   MP3 also adds a few milliseconds of silence to the beginning and end of the file.

Audacity is showing potential clipping where the level goes over 0dB.   Also, if you have a file that's truly clipped you can reduce the level by one dB and of course that doesn't remove the clipping but Audacity won't show any clipping.

If the MP3 goes over 0dB and you play the file at "full digital volume" you will clip your DAC (digital-to-analog converter) or if you convert to regular (integer) WAV, the WAV will be clipped at 0dB.  

Some people reduce the level by 1 or 2 dB before making MP3s but I've never hear of a case where that slight clipping was audible.   That is, I've never heard of a situation where there were MP3 compression artifacts and reducing the volume made the MP3 encoding transparent in an ABX test.  (And I don't know if anybody has done such a test.)

These were the replies I was looking for! Thank you very much for your assistance guys!