lame(1)

๐Ÿ“ฆ version 4.0, in ubuntu stonking

๐ŸŽ€ NAME ๐ŸŽ€

lame โ€” create mp3 audio files ๐Ÿ’– (yes, the manual is section 1, bestie, we're in lame(1) territory)


โœจ SYNOPSIS โœจ

lame [options] <infile> <outfile>

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

So LAME is this program you use to create compressed audio files. And before you ask โ€” the name literally stands for "Lame ain't an MP3 encoder". Iconic self-awareness, honestly. ๐Ÿ’…

The files it makes can be played back by all the popular MP3 players out there, like mpg123 or madplay. No cap.

Wanna read from stdin? Use - as your <infile>. Wanna write to stdout? Use - as your <outfile>. Easy. ๐Ÿซถ


๐ŸŒธ OPTIONS ๐ŸŒธ

๐ŸŽง Input options ๐ŸŽง

  • -r โ€” assume the input file is raw pcm, fr. Which means you must spell out the sampling rate and the mono/stereo/jstereo situation on the command line yourself. For every stereo sample, LAME expects the input data ordered left channel first, then right channel. By default it assumes they're signed integers with a bitwidth of 16, stored little-endian. Without -r, LAME does a bunch of fseek()'s on the input file hunting for WAV and AIFF headers. Heads up: this one might not be available on your release. ๐Ÿ™ˆ
  • -x โ€” swap bytes in the input file (or the output file when you're using --decode). It's the fix for little endian/big endian chaos. If your encoding sounds like static, try this first. Without -x, LAME treats the input file as native endian. ๐Ÿ’€
  • -s sfreq โ€” where sfreq = 8/11.025/12/16/22.05/24/32/44.1/48.

Only required for raw PCM input files โ€” otherwise it gets determined from the header of the input file. And yes, LAME will automatically resample the input file to one of the supported MP3 samplerates if it needs to. Slay. โœจ

  • --bitwidth n โ€” input bit width per sample, where n = 8, 16, 24, 32 (default 16).

Only required for raw PCM input files. Otherwise it gets determined from the header of the input file.

  • --signed โ€” tells LAME the samples from the input are signed (which is the default for 16, 24 and 32 bits raw pcm data).

Only required for raw PCM input files.

  • --unsigned โ€” tells LAME the samples from the input are unsigned (the default for 8 bits raw pcm data, where 0x80 is zero).

Only required for raw PCM input files, and only available at bitwidth 8.

  • --little-endian โ€” tells LAME the samples from the input are in little-endian form.

Only required for raw PCM input files.

  • --big-endian โ€” tells LAME the samples from the input are in big-endian form.

Only required for raw PCM input files.

  • --mp1input โ€” assume the input file is a MPEG Layer I (ie MP1) file. If the filename ends in .mp1, LAME just assumes it's a MPEG Layer I file on its own. But for stdin, or Layer I files that don't end in .mp1, you need this switch. ๐ŸŽ€
  • --mp2input โ€” assume the input file is a MPEG Layer II (ie MP2) file. If the filename ends in .mp2, LAME assumes MPEG Layer II by itself. For stdin or Layer II files not ending in .mp2, use this switch.
  • --mp3input โ€” assume the input file is a MP3 file. Super useful for downsampling from one mp3 to another โ€” for example it can be handy for streaming through an IceCast server. If the filename ends in .mp3, LAME assumes it's an MP3. For stdin or MP3 files that don't end in .mp3, you need this switch. ๐Ÿ”ฅ
  • --nogap file1 file2 ... โ€” gapless encoding for a set of contiguous files.
  • --nogapout dir โ€” output dir for gapless encoding. Must precede --nogap, bestie, don't forget.
  • --out-dir dir โ€” if no explicit output file is specified, a file gets written at the given path. Ignored when using piped/streamed input. ๐Ÿซถ

๐Ÿ› ๏ธ Operational options ๐Ÿ› ๏ธ

  • -m mode โ€” where mode = s, j, f, d, m, l, r.

Joint-stereo is the default mode for stereo files. Here's the whole menu:

  • (s)imple stereo (Forced LR) โ€” in this mode the encoder makes no use of potentially existing correlations between the two input channels. It can, however, negotiate the bit demand between both channels, i.e. give one channel more bits if the other contains silence or needs fewer bits because of lower complexity.
  • (j)oint stereo โ€” in this mode the encoder can use (on a frame by frame basis) either L/R stereo or mid/side stereo. In mid/side stereo, the mid (L+R) and side (L-R) channels get encoded, and more bits go to the mid channel than the side channel. When there isn't too much stereo separation, this effectively increases the bandwidth, so you get higher quality with the same amount of bits. ๐ŸŒˆ
Using mid/side stereo inappropriately can result in audible compression artifacts. Too much switching between mid/side and regular stereo can also sound bad. To determine when to switch to mid/side stereo, LAME uses a much more sophisticated algorithm than the one described in the ISO documentation.
  • (f)orced MS stereo โ€” forces all frames to be encoded with mid/side stereo. Use it only if you're sure that every frame of the input file has very little stereo separation.
  • (d)ual channel โ€” in this mode the 2 channels get totally independently encoded. Each channel gets exactly half of the bitrate. This mode is designed for things like dual language encoding (for example: English in one channel and French in the other). Using this encoding mode for regular stereo files will result in a lower quality encoding.
  • (m)ono โ€” the input gets encoded as a mono signal. If it was a stereo signal, it gets downsampled to mono. The downmix is calculated as the sum of the left and right channel, attenuated by 6 dB. Also note: if you're using a stereo RAW PCM stream, you need to use the -a parameter.
  • (l)eft channel only โ€” the input gets encoded as a mono signal. If it was a stereo signal, only the left channel gets encoded.
  • (r)ight channel only โ€” the input gets encoded as a mono signal. If it was a stereo signal, only the right channel gets encoded.
  • -a โ€” mix the stereo input file to mono and encode as mono. The downmix is the sum of the left and right channel, attenuated by 6 dB.

This option is only needed in the case of raw PCM stereo input (because LAME can't determine the number of channels in the input file). To encode a stereo RAW PCM input file as mono, use:

lame -a -m m

For WAV and AIFF input files, using -m m will always produce a mono .mp3 file from both mono and stereo input. ๐Ÿ’–

  • --freeformat โ€” produces a free format bitstream. With this option you can use -b with any bitrate higher than 8 kbps.

However โ€” even if an mp3 decoder is required to support free bitrates at least up to 320 kbps, many players are unable to deal with it. ๐Ÿ˜ญ

Tests have shown that the following decoders support free format:

  • in_mpg123 up to 560 kbps
  • l3dec up to 310 kbps
  • LAME up to 640 kbps
  • MAD up to 640 kbps
  • --decode โ€” uses LAME for decoding to a wav file. The input file can be any input type supported by encoding, including layer II files. LAME uses a fork of mpglib known as HIP for decoding. ๐Ÿ‘‘

If -t is used (disable wav header), LAME will output raw pcm in native endian format. You can use -x to swap byte order.

This option is not usable if the MP3 decoder was explicitly disabled in the build of LAME.
  • -t โ€” disable writing of the INFO Tag on encoding. This tag is embedded in frame 0 of the MP3 file. It includes some information about the encoding options of the file, and in VBR it lets VBR aware players correctly seek and compute playing times of VBR files.

When --decode is specified (decode to WAV), this flag disables writing of the WAV header. The output will be raw pcm, native endian format. Use -x to swap bytes. ๐Ÿฆ‹

  • --comp arg โ€” instead of choosing bitrate, with this option the user can choose the compression ratio to achieve.
  • --scale n, --scale-l n, --scale-r n โ€” scales input (every channel, only left channel, or only right channel, respectively) by n. This just multiplies the PCM data (after it's been converted to floating point) by n.
    • n > 1: increase volume ๐Ÿ”Š
    • n = 1: no effect ๐Ÿ˜
    • n < 1: reduce volume ๐Ÿ”‰
Use with care, since most MP3 decoders will truncate data which decodes to values greater than 32768.
  • --replaygain-fast โ€” compute ReplayGain fast but slightly inaccurately.

This computes "Radio" ReplayGain on the input data stream after user-specified volume-scaling and/or resampling.

The ReplayGain analysis does not affect the content of a compressed data stream itself โ€” it's a value stored in the header of a sound file. Info on the purpose of ReplayGain and the algorithms used lives at http://www.replaygain.org/.

Only the "RadioGain" Replaygain value gets computed, and it's stored in the LAME tag. The analysis is performed with the reference volume equal to 89dB. Note: the reference volume was changed from 83dB on transition from version 3.95 to 3.95.1. ๐Ÿ™ˆ

This switch is enabled by default.

See also: --replaygain-accurate, --noreplaygain

  • --replaygain-accurate โ€” compute ReplayGain more accurately and find the peak sample.

This computes "Radio" ReplayGain on the decoded data stream, finds the peak sample by decoding on the fly the encoded data stream, and stores it in the file.

The ReplayGain analysis does not affect the content of a compressed data stream itself โ€” it's a value stored in the header of a sound file. Info on the purpose of ReplayGain and the algorithms used lives at http://www.replaygain.org/.

okay so by default, LAME does its ReplayGain analysis on the input data โ€” and yes, that's after the user-specified volume scaling. ๐Ÿ’– But bestie, this can be slightly inaccurate because the data coming out of a lossy compression/decompression sequence is not the same as the initial input data. ๐Ÿ˜ญ When you specify --replaygain-accurate, the mp3 stream gets decoded on the fly and the analysis happens on the decoded data stream. Theoretically that's more accurate, but it has some disadvantages:

  • tests have shown that the difference between the ReplayGain values computed on the input data and decoded data is usually not greater than 0.5dB, although the minimum volume difference the human ear can perceive is about 1.0dB
  • decoding on the fly significantly slows down the encoding process

The apparent advantage is that:

  • with --replaygain-accurate the real peak sample is determined and stored in the file. Knowing the peak sample can be useful to decoders (players) to prevent a negative effect called 'clipping' that introduces distortion into the sound.

Only the "RadioGain" ReplayGain value is computed, and it's stored in the LAME tag. The analysis is performed with the reference volume equal to 89dB. Note: the reference volume has been changed from 83dB on transition from version 3.95 to 3.95.1. ๐Ÿ‘‘

This option is not usable if the MP3 decoder was explicitly disabled in the build of LAME. (Note: if LAME is compiled without the MP3 decoder, ReplayGain analysis is performed on the input data after user-specified volume scaling).

See also: --replaygain-fast, --noreplaygain --clipdetect

  • --noreplaygain โ€” Disable ReplayGain analysis.

By default ReplayGain analysis is enabled. This switch disables it.

See also: --replaygain-fast, --replaygain-accurate

  • --clipdetect โ€” Clipping detection.

Enable --replaygain-accurate and print a message whether clipping occurs and how far in dB the waveform is from full scale.

This option is not usable if the MP3 decoder was explicitly disabled in the build of LAME.

See also: --replaygain-accurate

  • --preset type | [cbr] kbps โ€” Use one of the built-in presets.

Have a look at the PRESETS section below.

--preset help gives more infos about the the used options in these presets.

  • --noasm type โ€” Disable specific assembly optimizations (mmx / 3dnow / sse). Quality will not increase, only speed will be reduced. If you have problems running Lame on a Cyrix/Via processor, disabling mmx optimizations might solve your problem. ๐Ÿ› ๏ธ

โœจ Verbosity โœจ

  • --disptime n โ€” Set the delay in seconds between two display updates.
  • --nohist โ€” By default, LAME will display a bitrate histogram while producing VBR mp3 files. This will disable that feature. Histogram display might not be available on your release.
  • -S, --silent, --quiet โ€” Do not print anything on the screen. ๐Ÿคซ
  • --verbose โ€” Print a lot of information on the screen. ๐Ÿ—ฃ๏ธ
  • --help โ€” Display a list of available options. ๐Ÿ†˜

๐ŸŽง Noise shaping & psycho acoustic algorithms ๐ŸŽง

  • -q qual โ€” 0 <= qual <= 9

Bitrate is of course the main influence on quality. The higher the bitrate, the higher the quality. But for a given bitrate, we have a choice of algorithms to determine the best scalefactors and Huffman encoding (noise shaping).

For CBR and ABR, the following table applies:

  • -q 0: Use the best algorithms (Best Huffman coding search, full outer loop, and the highest precision of several parameters).
  • -q 1 to q 4: Similar to -q 0 without the full outer loop and decreasing precision of parameters the further from q0. -q 3 is the default.
  • -q 5 and -q 6: Same as -q 7, but enables noise shaping and increases subblock gain
  • -q 7 to -q 9: Same as -f. Very fast, OK quality. Psychoacoustics are used for pre-echo and mid/side stereo, but no noise-shaping is done.

For the default VBR mode since LAME 3.98, the following table applies :

  • -q 0 to -q 4: include all features of the other modes and additionally use the best search when applying Huffman coding.
  • -q 5 and -q 6: include all features of -q7, calculate and consider actual quantisation noise, and additionally enable subblock gain.
  • -q 7 to -q 9: This level uses a psymodel but does not calculate quantisation noise when encoding: it takes a quick guess.
  • -h โ€” Alias of -q 2
  • -f โ€” Alias of -q 7

๐Ÿ’ฟ CBR (constant bitrate, the default) options ๐Ÿ’ฟ

  • -b n โ€” For MPEG-1 (sampling frequencies of 32, 44.1 and 48 kHz)

n = 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320

For MPEG-2 (sampling frequencies of 16, 22.05 and 24 kHz)

n = 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160

For MPEG-2.5 (sampling frequencies of 8, 11.025 and 12 kHz)

n = 8, 16, 24, 32, 40, 48, 56, 64

Default is 128 for MPEG1 and 64 for MPEG2 and 32 for MPEG2.5 (64, 32 and 16 respectively in case of mono).

  • --cbr โ€” enforce use of constant bitrate. Used to disable VBR or ABR encoding even if their settings are enabled.

๐Ÿ“Š ABR (average bitrate) options ๐Ÿ“Š

  • --abr n โ€” Turns on encoding with a targeted average bitrate of n kbits, allowing to use frames of different sizes. The allowed range of n is 8 - 310, you can use any integer value within that range.

It can be combined with the -b and -B switches like: lame --abr 123 -b 64 -B 192 a.wav a.mp3 which would limit the allowed frame sizes between 64 and 192 kbits.

The use of -B is NOT RECOMMENDED. A 128 kbps CBR bitstream, because of the bit reservoir, can actually have frames which use as many bits as a 320 kbps frame. VBR modes minimize the use of the bit reservoir, and thus need to allow 320 kbps frames to get the same flexibility as CBR streams. ๐Ÿ˜ค


๐Ÿ”ฅ VBR (variable bitrate) options ๐Ÿ”ฅ

  • -v โ€” use variable bitrate (--vbr-new)
  • --vbr-old โ€” Invokes the oldest, most tested VBR algorithm. It produces very good quality files, though is not very fast. This has, up through v3.89, been considered the "workhorse" VBR algorithm. ๐ŸŽ
  • --vbr-new โ€” Invokes the newest VBR algorithm. During the development of version 3.90, considerable tuning was done on this algorithm, and it is now considered to be on par with the original --vbr-old. It has the added advantage of being very fast (over twice as fast as --vbr-old). This is the default since 3.98. โšก
  • -V n โ€” 0 <= n <= 9.999

Enable VBR (Variable BitRate) and specifies the value of VBR quality (default = 4). Decimal values can be specified, like 4.51.

0 = highest quality.


๐ŸŽš๏ธ ABR and VBR options ๐ŸŽš๏ธ

  • -b bitrate โ€” For MPEG-1 (sampling frequencies of 32, 44.1 and 48 kHz)

n = 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320

For MPEG-2 (sampling frequencies of 16, 22.05 and 24 kHz)

n = 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160

For MPEG-2.5 (sampling frequencies of 8, 11.025 and 12 kHz)

n = 8, 16, 24, 32, 40, 48, 56, 64

Specifies the minimum bitrate to be used. However, in order to avoid wasted space, the smallest frame size available will be used during silences.

  • -B bitrate โ€” For MPEG-1 (sampling frequencies of 32, 44.1 and 48 kHz)

n = 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320

For MPEG-2 (sampling frequencies of 16, 22.05 and 24 kHz)

n = 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160

For MPEG-2.5 (sampling frequencies of 8, 11.025 and 12 kHz)

n = 8, 16, 24, 32, 40, 48, 56, 64

Specifies the maximum allowed bitrate.

Note: If you own an mp3 hardware player build upon a MAS 3503 chip, you must set maximum bitrate to no more than 224 kpbs.

  • -F โ€” Strictly enforce the -b option.

This is mainly for use with hardware players that do not support low bitrate mp3.

Without this option, the minimum bitrate will be ignored for passages of analog silence, i.e. when the music level is below the absolute threshold of human hearing (ATH).


๐Ÿงช Experimental options ๐Ÿงช

  • -X n โ€” 0 <= n <= 7

When LAME searches for a "good" quantization, it has to compare the actual one with the best one found so far. The comparison says which one is better, the best so far or the actual. The -X parameter selects between different approaches to make this decision, -X0 being the default mode:

  • -X0: The criteria are (in order of importance):
    • less distorted scalefactor bands
    • the sum of noise over the thresholds is lower
    • the total noise is lower
  • -X1: The actual is better if the maximum noise over all scalefactor bands is less than the best so far.
  • -X2: The actual is better if the total sum of noise is lower than the best so far.
  • -X3: The actual is better if the total sum of noise is lower than the best so far and the maximum noise over all scalefactor bands is less than the best so far plus 2dB.
  • -X4: Not yet documented.
  • -X5: The criteria are (in order of importance):
    • the sum of noise over the thresholds is lower
    • the total sum of noise is lower
  • -X6: The criteria are (in order of importance):
    • the sum of noise over the thresholds is lower
    • the maximum noise over all scalefactor bands is lower
    • the total sum of noise is lower
  • -X7: The criteria are:
    • less distorted scalefactor bands or
    • the sum of noise over the thresholds is lower
  • -Y โ€” lets LAME ignore noise in sfb21, like in CBR

๐Ÿท๏ธ MP3 header/stream options ๐Ÿท๏ธ

  • -e emp โ€” emp = n, 5, c

n = (none, default)

5 = 0/15 microseconds

c = citt j.17

Okay so all this does is set a flag in the bitstream. โœจ If you have a PCM input file where one of the above types of (obsolete) emphasis has been applied, you can set this flag in LAME. Then the mp3 decoder should de-emphasize the output during playback, although most decoders ignore this flag. ๐Ÿ˜ญ

A better solution would be to apply the de-emphasis with a standalone utility before encoding, and then encode without -e. ๐Ÿ’…

  • -c โ€” Mark the encoded file as being copyrighted. ๐Ÿ’–
  • -o โ€” Mark the encoded file as being a copy. ๐Ÿ‘ฏ
  • -p โ€” Turn on CRC error protection. It will add a cyclic redundancy check (CRC) code in each frame, allowing to detect transmission errors that could occur on the MP3 stream. However, it takes 16 bits per frame that would otherwise be used for encoding, and then will slightly reduce the sound quality. โš ๏ธ
  • --nores โ€” Disable the bit reservoir. Each frame will then become independent from previous ones, but the quality will be lower. ๐Ÿซ 
  • --strictly-enforce-ISO โ€” With this option, LAME will enforce the 7680 bit limitation on total frame size. This results in many wasted bits for high bitrate encodings but will ensure strict ISO compatibility. This compatibility might be important for hardware players. ๐Ÿ”ฅ

๐ŸŒธ Filter options ๐ŸŒธ

  • --lowpass freq โ€” Set a lowpass filtering frequency in kHz. Frequencies above the specified one will be cutoff. ๐ŸŽš๏ธ
  • --lowpass-width freq โ€” Set the width of the lowpass filter. The default value is 15% of the lowpass frequency. ๐Ÿ“
  • --highpass freq โ€” Set an highpass filtering frequency in kHz. Frequencies below the specified one will be cutoff. ๐ŸŽš๏ธ
  • --highpass-width freq โ€” Set the width of the highpass filter in kHz. The default value is 15% of the highpass frequency. ๐Ÿ“
  • --resample sfreq โ€” sfreq = 8, 11.025, 12, 16, 22.05, 24, 32, 44.1, 48 <br> Select output sampling frequency (only supported for encoding). If not specified, LAME will automatically resample the input when using high compression ratios. ๐ŸŒ€

๐Ÿท๏ธ ID3 tag options ๐Ÿท๏ธ

  • --tt title โ€” audio/song title (max 30 chars for version 1 tag) ๐ŸŽต
  • --ta artist โ€” audio/song artist (max 30 chars for version 1 tag) ๐ŸŽค
  • --tl album โ€” audio/song album (max 30 chars for version 1 tag) ๐Ÿ’ฟ
  • --ty year โ€” audio/song year of issue (1 to 9999) ๐Ÿ“…
  • --tc comment โ€” user-defined text (max 30 chars for v1 tag, 28 for v1.1) ๐Ÿ’ฌ
  • --tn track[/total] โ€” audio/song track number and (optionally) the total number of tracks on the original recording. (track and total each 1 to 255. Providing just the track number creates v1.1 tag, providing a total forces v2.0). ๐Ÿ”ข
  • --tg genre โ€” audio/song genre (name or number in list) ๐ŸŽผ
  • --tv id=value โ€” Text or URL frame specified by id and value (v2.3 tag). User defined frame. Syntax: --tv "TXXX=description=content" ๐Ÿ“
  • --add-id3v2 โ€” force addition of version 2 tag โž•
  • --id3v1-only โ€” add only a version 1 tag 1๏ธโƒฃ
  • --id3v2-only โ€” add only a version 2 tag 2๏ธโƒฃ
  • --id3v2-latin1 โ€” add following options in ISO-8859-1 text encoding. ๐Ÿ”ค
  • --id3v2-utf8 โ€” add following options in unicode UTF-8 text encoding (ID3v2.4). ๐Ÿ”ค
  • --id3v2-utf16 โ€” add following options in unicode UCS-2 text encoding (ID3v2.3). ๐Ÿ”ค
  • --space-id3v1 โ€” pad version 1 tag with spaces instead of nulls โฃ
  • --pad-id3v2 โ€” same as --pad-id3v2-size 128 ๐Ÿ›‹๏ธ
  • --pad-id3v2-size num โ€” adds version 2 tag, pad with extra "num" bytes ๐Ÿ›‹๏ธ
  • --genre-list โ€” print alphabetically sorted ID3 genre list and exit ๐Ÿ“œ
  • --ignore-tag-errors โ€” ignore errors in values passed for tags, use defaults in case an error occurs ๐Ÿšซ

๐Ÿ” Analysis options ๐Ÿ”

  • -g โ€” run graphical analysis on <infile>. <infile> can also be a .mp3 file. (This feature is a compile time option. Your binary may for speed reasons be compiled without this.) ๐Ÿ“Š

๐Ÿท๏ธ ID3 TAGS ๐Ÿท๏ธ

LAME is able to embed ID3 v1, v1.1 or v2 tags inside the encoded MP3 file. This allows one to have some useful information about the music track included inside the file. Those data can be read by most MP3 players. ๐ŸŽง

Lame will smartly choose which tags to use. It will add ID3 v2 tags only if the input comments won't fit in v1 or v1.1 tags, i.e. if they are more than 30 characters. In this case, both v1 and v2 tags will be added, to ensure reading of tags by MP3 players which are unable to read ID3 v2 tags. ๐Ÿง 

๐ŸŽš๏ธ ENCODING MODES ๐ŸŽš๏ธ

LAME is able to encode your music using one of its 3 encoding modes: constant bitrate (CBR), average bitrate (ABR) and variable bitrate (VBR). ๐ŸŽถ

Constant Bitrate (CBR) ๐Ÿ’ 

This is the default encoding mode, and also the most basic. In this mode, the bitrate will be the same for the whole file. It means that each part of your mp3 file will be using the same number of bits. The musical passage being a difficult one to encode or an easy one, the encoder will use the same bitrate, so the quality of your mp3 is variable. Complex parts will be of a lower quality than the easiest ones. The main advantage is that the final files size won't change and can be accurately predicted. ๐Ÿ“

Average Bitrate (ABR) ๐Ÿ“Š

In this mode, you choose the encoder will maintain an average bitrate while using higher bitrates for the parts of your music that need more bits. The result will be of higher quality than CBR encoding but the average file size will remain predictable, so this mode is highly recommended over CBR. This encoding mode is similar to what is referred as vbr in AAC or Liquid Audio (2 other compression technologies). ๐ŸŽฏ

Variable bitrate (VBR) ๐ŸŽข

In this mode, you choose the desired quality on a scale from 9 (lowest quality/biggest distortion) to 0 (highest quality/lowest distortion). Then encoder tries to maintain the given quality in the whole file by choosing the optimal number of bits to spend for each part of your music. The main advantage is that you are able to specify the quality level that you want to reach, but the inconvenient is that the final file size is totally unpredictable. ๐ŸŽฒ

โœจ PRESETS โœจ

The --preset switches are aliases over LAME settings. ๐ŸŽ›๏ธ

To activate these presets:

For VBR modes (generally highest quality):

  • --preset medium โ€” This preset should provide near transparency to most people on most music. ๐Ÿ’Ž
  • --preset standard โ€” This preset should generally be transparent to most people on most music and is already quite high in quality. ๐ŸŒŸ
  • --preset extreme โ€” If you have extremely good hearing and similar equipment, this preset will generally provide slightly higher quality than the standard mode. ๐Ÿ‘‚

For CBR 320kbps (highest quality possible from the --preset switches):

  • --preset insane โ€” This preset will usually be overkill for most people and most situations, but if you must have the absolute highest quality with no regard to filesize, this is the way to go. ๐Ÿคฏ

For ABR modes (high quality per given bitrate but not as high as VBR):

  • --preset kbps โ€” Using this preset will usually give you good quality at a specified bitrate. Depending on the bitrate entered, this preset will determine the optimal settings for that particular situation. While this approach works, it is not nearly as flexible as VBR, and usually will not attain the same level of quality as VBR at higher bitrates. ๐Ÿ“ˆ
  • cbr โ€” If you use the ABR mode (read above) with a significant bitrate such as 80, 96, 112, 128, 160, 192, 224, 256, 320, you can use the --preset cbr kbps option to force CBR mode encoding instead of the standard ABR mode. ABR does provide higher quality but CBR may be useful in situations such as when streaming an MP3 over the Internet may be important. ๐ŸŒ

๐ŸŽง EXAMPLES ๐ŸŽง

Fixed bit rate jstereo 128kbs encoding:

lame -b 128 sample.wav sample.mp3

Fixed bit rate jstereo 128 kbps encoding, highest quality:

lame -q 0 -b 128 sample.wav sample.mp3

To disable joint stereo encoding (slightly faster, but less quality at bitrates <= 128 kbps):

lame -m s sample.wav sample.mp3

Variable bitrate (use -V n to adjust quality/filesize):

lame -V 2 sample.wav sample.mp3

Streaming mono 22.05 kHz raw pcm, 24 kbps output:

cat inputfile | lame -r -m m -b 24 -s 22.05 - - > output

Streaming mono 44.1 kHz raw pcm, with downsampling to 22.05 kHz:

cat inputfile | lame -r -m m -b 24 --resample 22.05 - - > output

Encode with the standard preset:

lame --preset standard sample.wav sample.mp3

๐Ÿ’€ BUGS ๐Ÿ’€

Probably there are some. ๐Ÿคทโ€โ™€๏ธ

๐Ÿ‘€ SEE ALSO ๐Ÿ‘€

mpg123(1), madplay(1), sox(1)

๐Ÿ‘‘ AUTHORS ๐Ÿ‘‘

LAME originally developed by Mike Cheng and now maintained by Mark Taylor, and the LAME team. ๐Ÿ™Œ

GPSYCHO psycho-acoustic model by Mark Taylor. (See https://lame.sourceforge.io/). ๐Ÿ”—

mpglib by Michael Hipp ๐Ÿ˜

Manual page by William Schelter, Nils Faerber, Alexander Leidinger, and Rogรฉrio Brito. โœ๏ธ


Anyway bestie, this whole page is from LAME 3.99, dated December 08, 2013, and it's the lame(1) manual. Slay! ๐Ÿ’–โœจ

๐Ÿ“ฆ where this page comes from