schneck
schneck

Reputation: 10847

Determine bit depth in mp3 file

Since an MP3-File has no fixed bit depth like a PCM-Stream, a decoder (e.g. lame) must determine what bit depth to use when converting an mp3-stream into a PCM-Stream. Does it work by using a default value (propably 16) or is there any other way?

Upvotes: 3

Views: 4400

Answers (3)

hhaamu
hhaamu

Reputation: 7371

The MP3 format [1], when decoded, does have a (sort of) fixed bit depth: floating point. If you are not satisfied with that, you should translate it to a linear integer format [1], with a size of your choosing (8, 16, or 24 bits usually). Since 16 bits is what the majority of sound cards can handle, that's what it is often decoded to.

More information: http://mp3decoders.org/24bit.html



[1] I'm extrapolating this from what I know about other formats. It may not hold true for MP3.
[2] Most decoder libraries can do this for you. If you try to do it yourself, don't forget to dither

Upvotes: 1

rslite
rslite

Reputation: 84813

I'm not familiar in-depth with MP3 format, but isn't it possible to decode to any bit depth you want? I mean you set the wanted value at the beginning and the decoding takes that into account, so you could decode to any bit depth you need.

Upvotes: 0

Tullo_x86
Tullo_x86

Reputation: 2673

It varies depending on the particular frame of compressed data. The decoder determines the resulting PCM stream's bit-depth.

Upvotes: 2

Related Questions