Bit depth to MP3

Should my songs be 24bit or 16bit when encoding to MP3s?
Thanks for the responses!

mp3's don't use "bit depth" in the way a wav or aif does.

Just encode the mp3 from your session (or from your printed stereo mix)... it makes no difference whatsoever.
 
dvyce, I think he's really just asking if the mp3 encoding works better with a 24bit source. It's a really good question IMO, I never checked out how mp3 encoders handle bit-rate convertion. I know that an implicit sample-rate conversion sounds horrible in all encoders, but they could benefit from a higher bit-depth, or not. I don't know.
 
Frankly, I don't know how that extra 8 bits of data fits into mp3 bitrate. I wonder if it hurts more than helps.

For example: If you do 16bits/44.1khz@320kbps then mp3 encoding removes some data from lossless audio into lossy. Fitting in 24bits/44.1khz@320kbps would need more data, but since the kbps is the same, then that extra data for the bit depth has to come from somewhere. So I wonder if you lose more frequencies to make space for the added bit depth.

I never actually thought about it until now. I don't use mp3 enough and when I do the quality doesn't really matter.
 
If you're converting to 320kbps, you'd simply be throwing away more data with a 24-bit source file to get there. It certainly wouldn't hurt to have a higher bit-depth to start with. Whether or not you get a better quality MP3 (or how *much* better), I don't know.

Here's a pretty good layman's explanation of the MP3 conversion process:
h2g2 - A Guide to the MP3 File Conversion Process
 
Frankly, I don't know how that extra 8 bits of data fits into mp3 bitrate. I wonder if it hurts more than helps.

For example: If you do 16bits/44.1khz@320kbps then mp3 encoding removes some data from lossless audio into lossy. Fitting in 24bits/44.1khz@320kbps would need more data, but since the kbps is the same, then that extra data for the bit depth has to come from somewhere. So I wonder if you lose more frequencies to make space for the added bit depth.

I never actually thought about it until now. I don't use mp3 enough and when I do the quality doesn't really matter.

An mp3 is it's own format and sample rate and bit depth do not apply to them in the same way as they do to wav/aif files.

1. Regardless of what the original file type/rate/depth is, the mp3 encoder "listens" to it and makes the mp3.

2. If you feed it a higher quality track, your mp3 will be higher quality. It creates an mp3 based on the source material. Better quality in equals better quality out. But the quality would be better with a 44.1/24 than a 44.1/16 because the 44.1/24 is a better quality file... Not because mp3 conversion works better with a 44.1/24 file as a source.

3. Whatever your native session settings are is what you should make your mp3 from. This is because that is the best you can get from your session. As we all know, converting a 16bit file to 24bit will not increase your quality. You will not increase the quality of your 16bit file.
 
And mp3 is it's own format and sample rate and bit depth do not apply to them in the same way as they do to wav/aif files.

1. Regardless of what the original file type/rate/depth is, the mp3 encoder "listens" to it and makes the mp3.

2. If you feed it a higher quality track, your mp3 will be higher quality. It creates an mp3 based on the source material. Better quality in equals better quality out. But the quality would be better with a 44.1/24 than a 44.1/16 because the 44.1/24 is a better quality file... Not because mp3 conversion works better with a 44.1/24 file as a source.

3. Whatever your native session settings are is what you should make your mp3 from. This is because that is the best you can get from your session. As we all know, converting a 16bit file to 24bit will not increase your quality. You will not increase the quality of your 16bit file.

I get that. It's not really a question of quality. Of course, better input quality generally = better output quality.

Here's what I don't get. An mp3 file is 320kbps max, unless I missed something. So 320kbps is the limit regardless of what your source is. So I can render an mp3 file at 320kbps. A constant bitrate. Let's assume that the bitrate will give me a 5mb file. So regardless whether my quality is crap, or great, I will end up with a 5mb file due to that constant bitrate. Now, a 16bit/44.khz@320kbps=5mb, where does the loss occur for 24bit/44.1khz@320kbps=5mb to be possible?
 
This is possibly the greatest discussion of .mp3 that I've ever witnessed.

I'm posting this in my blog.

Peace.
 
Now, a 16bit/44.khz@320kbps=5mb, where does the loss occur for 24bit/44.1khz@320kbps=5mb to be possible?

You can't really think of it like that since the files don't relate in that way.

You are not really "losing bits"... and you are not gaining bits if you make and 8bit/44.1@320kbps...

The file is going into the "mp3 machine" where it is "listened to and analyzed" (so to speak) and a picture is taken through it's 320kbps lens (sorry for mixing metaphors)...

Like if you filmed your HDTV screen using a VHS camera... you wouldn't wonder where all the pixels went... the VHS camera is just recording an image of the HDTV as it is seen through it's lens.

and if you recorded the images from a CGA greenscreen monitor using the same camera, the recording would still use the same amount of tape and it would be a VHS image of what the camera "saw"...

This is the case even though one image in its native form contains much more data than the other... but when looked at as a whole through the new lens, they are seen as the same... they are both just pictures of a screen at which the camera is pointed.

They would both be VHS representations of different quality images and neither would have a direct relation to the original image or to eachother with regard to "where the pixels went"... the images have essentially been reanalyzed from the ground up to be transformed to an entirely new format.


(...at least that is how I understand it to be.)
 
Ok, I did a little research regarding the lame library (i.e. "lame mp3 encoder"). Nearly all audio-apps use a LAME based encoder because the original Frauenhofer MP3 encoder is patented and doesn't allow modifications.


The subject is very complex and hard to generalize. Many applications use their own modifications of the core LAME encoder, and only few apps really use all the options offered by the core LAME library. The final sound quality and calculation speed can't be generalized. This makes it difficult to say anything general about the effect of a high input precision, for example 16bit vs 24bit. Or a higher samplerate.

Serious mp3 encoders would carefully prepare the wav files before doing the actual mp3 convertions, for example really high quality sample-rate convertion, floating point to fixed-point convertion (i.e. normalization) or advanced "playback clipping after decoding" prevention. A good encoder would use the highest quality but insanely slow HQ settings that most free mp3 encoding apps don't offer at all, or stuff like grouped replaygain (for albums).. All these things are very hard to predict. For example, I observed that Soundforges' mp3 encoder does a really bad job, it sounds worse than some free apps! Shame on Sony.


However, I can confirm that the original LAME encoder will deliver "better" results for a 24bit input (compared to 16bit). LAME will definitely use the additional information and greatly increase the processing quality (much like vst plugins do). LAME will not truncate the input before conversion. Good news IMO. However, Inever really compared it in practice.

But, LAME will resample the material if required and this converter's performance is far lower than professional sample rate converters, it's optimized for speed, not quality. So it's a good idea to not force any implicit samplerate convertion by LAME and convert the source to the target mp3 samplerate.


Again, the two points above are totally dependent of the hosting application.

So in case you don't fear the command line and/or batch files, download the command line tool:
Download LAME MP3 Encoder 3.99.3 : LAME MP3 Encoder is the best mp3 encoder
and use this guide to tweak the settings to taste:
http://lame.cvs.sourceforge.net/viewvc/lame/lame/USAGE
you can simply run the exe via command line or batch file using adding the according parameters. This seems a little "geekish", but is much easier and faster than anything else once you get used to it. The main point is that you can tweak lame to death, you have all options at hand.

I use a simple ".bat" batchfile to automatically convert all files from one directory to another with "full quality" settings. I just have to move the files into that specific directory and double-click the batch file. Highly recommended!! :)

Here are some simple command examples: Some command line examples



These were my starting points if interested, beware, this is software dev talk.

LAME MP3 Encoder
LAME - Hydrogenaudio Knowledgebase

Here's the official mailing list containing the real details:
mp3encoder Info Page
 
Last edited:
However, I can confirm that the original LAME encoder will deliver "better" results for a 24bit input (compared to 16bit). LAME will definitely use the additional information and greatly increase the processing quality (much like vst plugins do). LAME will not truncate the input before conversion. Good news IMO. However, Inever really compared it in practice.

But that is really just confirming what I had said. All that illustrates is that a 24bit file will sound better than a 16bit file, which is naturally true because the source material is higher quality.

But to determine if an mp3 encoder works better with a 24 or 16 bit file as a general rule, the test would be:

If you take a 16 bit file and convert it to 24 bit, then convert both the "native 24 bit file" as well as the "converted-from-16-bit file" to mp3-- would the 24 bit file sound better (even though the added bits are not adding any quality to the file since the quality is still no better than the 16 bit file from which it was converted)? or would they both sound itentical (since both wav files actually theoretically contain the same quality audio as they were born from the same source)?

This would illustrate whether mp3 encoding "works better with a particular bit depth"... know what I mean?




But, LAME will resample the material if required and this converter's performance is far lower than professional sample rate converters, it's optimized for speed, not quality. So it's a good idea to not force any implicit samplerate convertion by LAME and convert the source to the target mp3 samplerate.

What is the "samplerate of an mp3"? I have never seen an mp3 referred to in relation to an actual "samplerate".
 
Oh yes, I just wasn't really sure until I checked the documentation. It could have been possible that LAME works with 16bit internally or that it would simply truncate the incoming audio to 16bit without care. the whole mp3 community never really cared much about audio-quality, the main motivation factors are speed and compression ratio.

MP3s really have a "samplerate", kind of. They are "prepared" for a certain target rate. Decoders will create a wav file with the samplerate of the mp3 "samplerate", they have no choice. (dvyce, you see the quotation marks? ;) )
The LAME encoder above accepts a specific target samplerate parameter.
 
Last edited:
Well When I convert my .wav files to mp3 using Logic Pro 8 it does associate a sample rate with the mp3. If I use a 48k sample rate in my session, then convert to mp3, it calls that a 320kb 48k .mp3 file.

I can tell this, because when I add the file to my itunes library, right click on it, and choose "get info", it says this.

"Type: MPEG Audio file
Size: 9.6 mb
Bit rate: 320 kb
Sample Rate: 48.000 kHz <----- right there
Date Modified: 1/1/11
Plays: 10
Last played: _____
Format: MPEG-1, layer 3
Channels: Joint stereo
ID3 Tag: v2.2
Encoded with: Logic Express 8.0.2"

if you have iTunes, try it out. So if .mp3's don't associate a sample rate, then what does that mean??

Also, when I've tried uploading these .mp3s to soundclick.com, it won't allow it. I have to go back and do a sample rate conversion on the original .wav file to make it 44.100 kHz, then convert that .wav to an .mp3 file. If I do that, soundclick will accept it. It says somewhere on the website that they only accept .mp3s which are 44.100 kHz.

It seems to me that .mp3s do factor in a sample rate, but maybe I'm missing something...??

Good discussion btw!
 
I'm not debating whether a 24 bit depth input is better than a 16 bit depth input. I'm just focusing on the output. I assume the OP is, also. I finally ran a test with FLStudio. Their max bitrate for export is 450kbps.

A stock/demo FLStudio song file resulted in

16 bits / 44.1khz / 450kbps = 10.8megabytes
24 bits / 44.1khz / 450kbps = 10.8megabytes
32 bits / 44.1khz / 450kbps = 10.8megabytes

Which confirmed my thoughts that if the file size is the same regardless of the settings when dealing with CBR. So my thought was how can the 24 bit file be better than the 16 bit file (both outputs) when they are the same size? If anything, the 16 bit file should be better since mp3 cuts out high and low frequencies and a bigger 24 bit depth would need data, which I'd assume would come from the frequency range.

In practical terms, all of the exports cancel out when phase is inverted on one of the exported files. The only thing that is audible is random artifacts, which is expected.

At the end of the day, I'll stick with 16 bit mp3 files and just use the highest bitrate if quality is some sort of important factor. Seems like the bit depth doesn't affect the actual output in any way when going above 16 bits.

Also noteworthy, Windows 7, Cubase, Wavelab, VLC media player all show 320kbps bitrate for all of the files regardless of bit depth even though they were all exported at 450kbps in FLStudio.
 
MP3s really have a "samplerate", kind of. They are "prepared" for a certain target rate. Decoders will create a wav file with the samplerate of the mp3 "samplerate", they have no choice. (dvyce, you see the quotation marks? ;) )
The LAME encoder above accepts a specific target samplerate parameter.

Why, yes... I do see the quotation marks! :)

Would I be correct in supposing that you are using the quotation marks for the same reason I was using them?

I typically use them to denote when I am using a term in a non literal, figurative or poetic manner... for example talking about the "mp3 machine" or the converter "listening to the audio" or the camera "seeing" or referring to kbps as "kabops" (and sometimes I use them for emphasis when it is too much of a hassle to type all the bracket and slash codes while posting from my phone... and sometimes I am just quoting someone :) )


That being said, your post still does not really clarify the question of the "samplerate" of MP3's (in quotes because I am not sure they have a samplerate in the same sense of wav/aif files where you can say "this mp3 has a 44.1k samplerate")

OK, so the "Decoders will create a wav file with the samplerate of the mp3 samplerate"... but what is the mp3 samplerate?
 
Back
Top