Help - Search - Members - Calendar
Full Version: lame: "--resample" question
Hydrogenaudio Forums > Lossy Audio Compression > MP3 > MP3 - General
dentament
Hi all.
I need to produce low bitrate (around 24kbps) mp3 with lame, preserving the original files' sample rate, 44.1 khz; but when encoding to 24kbps Lame by default resamples to 8000hz, so I add "--resample 44.1" to "--abr 24". Does "--resample 44.1" in this case simply make Lame not touch at all the sample rate (as I hope), or, if it applies a "resample to 44.1 algorithm" although the original data is already 44.1 khz, does this passage cause some more loss?
sven_Bent
i believe somewhere on hydrogen audio someone wrote that
resampling from freq to the same freq should leave the data untouched ( no rounding errors).
dentament
QUOTE(sven_Bent @ Jul 31 2007, 01:08) *

i believe somewhere on hydrogen audio someone wrote that
resampling from freq to the same freq should leave the data untouched ( no rounding errors).


do you mean "someone wrote it should work this way" or "someone wrote it seems it already works this way"?
...I'm new at hydrogen audio smile.gif
dentament
Ok, from the docs in cvs (http://lame.cvs.sourceforge.net/*checkout*/lame/lame/USAGE):

QUOTE
If not specified, LAME may sometimes resample automatically
when faced with extreme compression conditions (like encoding
a 44.1 kHz input file at 32 kbps). To disable this automatic
resampling, you have to use --resamle to set the output samplerate
equal to the inptu samplerate. In that case, LAME will not
perform any extra computations.
pdq
Overriding LAME's defaults will almost always result in worse quality, that's why they are the defaults. In this case I don't think you will like the sound you get when encoding at 44.1 kHz and 24 kbps.
dentament
I can't use 8000hz (the default resample by lame for 24kbps) since those mp3 are to be dinamically loaded by a "flash player" for streaming on slow connections (hence the low bitrate), and it turns out that flash can play them correctly only if the samplerate is "multiple of 11025hz" (so the help states) ... so now I'm using "--abr 24 --resample 11" instead of "--abr 24 --resample 44" (initially, when wondering why flash played those 24kbps:8khz mp3 at a higher speed and pitch, I guessed it could play right only 44.1 mp3).
I can't tell how they sounded with "--abr 24 --resample 44" since I didn't pay attention, anyway now with "--abr 24 --resample 11" at least they don't seem to me to sound worse than those at 8000hz I made with "--abr 24" (!)
Dynamic
You might just want to check to see if there's a difference between:

lame --abr 24 --resample 11

and the more correct:

lame --abr 24 --resample 11.025

It only amounts to about 1/25th of a semi-tone musical mistuning, but in some applications, you may accumulate an important mistiming (e.g. audio/video synchronisation) if an 11.000 kHz file is actually played at 11.025 kHz by flash player.
dentament
QUOTE(Dynamic @ Jul 31 2007, 20:56) *

You might just want to check to see if there's a difference between:
lame --abr 24 --resample 11
and the more correct:
lame --abr 24 --resample 11.025


No difference: --resample 11 is an alias for --resample 11.025
(don't know why I took this for granted smile.gif )

CODE
$ lame --abr 24 --resample 11 a.wav -o a.mp3
LAME 3.97 32bits (http://www.mp3dev.org/)
Resampling:  input 44.1 kHz  output 11.025 kHz

Dynamic
QUOTE(dentament @ Aug 1 2007, 01:36) *

No difference: --resample 11 is an alias for --resample 11.025


That's useful info to know. Thanks.
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.