Help - Search - Members - Calendar
Full Version: Detection of preset in VBR files
Hydrogenaudio Forums > Lossy Audio Compression > MP3 > MP3 - Tech
h0D
Hey, all

I have been searching for a way to detect which preset has been used when an mp3 file was created. At one point I found some code which contained a routine to detecting this, and it seemed to work for a while.

Now I've started to see files created with LAME 3.92 which doesnt show a preset in the same place as my code detects it in LAME 3.91. sad.gif

Can anyone direct me to a doc or some sample src which works ?

biggrin.gif

/h0D
getID3()
If you're just looking for a simple way to detect preset used from an end-user point of view: LameTag by phwip


If you want the gory programming details, here they are:

http://gabriel.mp3-tech.org/mp3infotag.html
Look at bytes $B6-$B7

The preset used is stored as an 11-bit number (0-2047). What that value represents varies by version of LAME. Note that the preset value is stored in the LAME tag only for LAME v3.93 onwards (and some later compiles of 3.90.3).

Preset values <= 320 represent "--[alt-]preset <bitrate>". For 3.90-3.92 these are CBR, for 3.93+ and 3.90.3 these are ABR.

LAME 3.93 and 3.90.3 use these preset values:
1000 = '--r3mix'
1001 = '--alt-preset standard'
1002 = '--alt-preset extreme'
1003 = '--alt-preset insane'
1004 = '--alt-preset fast standard'
1005 = '--alt-preset fast extreme'
1006 = '--alt-preset medium'
1007 = '--alt-preset fast medium'

LAME 3.94 (except early alpha compiles) changes the number stored to coincide with the presets equalling certain combinantions of -V -q switches, and are as follows:
430 = '--preset radio'
450 = '--preset portable'
460 = '--preset medium'
480 = '--preset standard'
500 = '--preset extreme'
Whether the preset is "fast" or not is determined now only by the vbr_method being equal to "4" (fast) or not.

For LAME before v3.93 (except recent 3.90.3) it's not possible to determine the preset used by the above method (because the value is not stored) but it may be possible to guess the preset used based on things like lowpass frequency, noise shaping method, stereo mode, etc.
h0D
EXCELLENT!

that was exactly the info I was looking for!....

Thx alot.. smile.gif

/h0D
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.