Skip to main content

Topic: 24 bit lossless to mp3 using lame (Read 6294 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • mezzanine
  • [*]
24 bit lossless to mp3 using lame
I want to convert a 24 bit FLAC to v0 mp3. (the source is not vinyl, I'd like to avoid that conversation)
Currently its highest peak is -9dBFS which is pretty quiet. Should I normalize the 24-bit file so that it peaks at the maximum value first?

An alternative way to word this question:
Does lame truncate 24 bits to 16 bits before encoding?

I'm also curious about dithering. Should I dither to 16 bits using a high quality algorithm like SoX and then feed that to lame to encode?

Thanks!

  • hlloyge
  • [*][*][*][*][*]
24 bit lossless to mp3 using lame
Reply #1
AFAIK, mp3 doesn't really have bit-depth. So, you could normalize it to almost 0 dB (I would do peak normalization to -1 dB), and then just send it to encoder.
Maybe there is better way.
  • Last Edit: 19 January, 2012, 05:54:54 AM by hlloyge

24 bit lossless to mp3 using lame
Reply #2
I actually did tests on some encoders last week with 24 bit integer files and "an mp3 encoder" was one of very few that preserved sounds around -130dBFS just like it would sound around -13dBFS. Regards.

  • DVDdoug
  • [*][*][*][*][*]
24 bit lossless to mp3 using lame
Reply #3
Quote
An alternative way to word this question:  Does lame truncate 24 bits to 16 bits before encoding?
No.

Quote
Currently its highest peak is -9dBFS which is pretty quiet. Should I normalize the 24-bit file so that it peaks at the maximum value first?
If it "feels" too quiet, then yes I'd normalize.  Since you are probably going to crank-up the volume during playback, you might as well make it more convenient by "permanently" cranking-up the volume. 

Quote
I'm also curious about dithering. Should I dither to 16-bits using a high quality algorithm like SoX and then feed that to lame to encode?
In this case, you don't need to downsample.   

Whenever you downsample to 16-bits, it's up to you if you want to dither or what algorithm/application you want to use...  At 16-bits, the dither is somewhere around -90dB and nobody is going to know if you dithered or not, or if you used a "good" dither algorithm.

  • slks
  • [*][*][*][*]
24 bit lossless to mp3 using lame
Reply #4
The bit depth refers to the number of bits used to represent the amplitude of one sample, in uncompressed PCM audio. MP3 uses some kind of mathematical trickery on the audio signal (I believe it's called an FFT) so that each sample does not have to be represented individually, thus there is no bit depth in an MP3 file.

However, when your MP3 gets converted back to PCM audio during playback, it again has a bit depth. Now generally with audio editing software, and for foobar2000, they decode to 32-bit PCM internally, so you won't have any issues with the audio levels being too close to the noise floor there.

So, if you wish, you can leave the audio as-is (peaking at -9 dB) and not run into any problems. LAME accepts 24-bit PCM input directly, and the MP3s internally have no bit depth, so you won't run into any problems from the signal level being too low, unless you end up having to convert it to 16-bit PCM at some point in the future (for example, if you want to put it on a CD). Even then, the quantization noise from the lower bit depth may or may not be audible. That depends more on the average signal level, rather than the peaks.

What I always do with the audio is to normalize it so that the highest peak is at 0 dB, this way I get the maximum amount of volume. If your highest peak is at -9 dB, and you end up converting the audio to 16-bit at some point, you effectively only use 14.5 bits of resolution. (Each bit adds another 6 dB of dynamic range).