LAME

Command-line MP3 encoder that turns a WAV file into MP3 at a fixed bit rate or a VBR quality, and turns an MP3 back into WAV (audio only).

What is known from testing

On 2026-11-15, the headlesson operator ran all 9 steps of this lesson with LAME 4.0 (macOS 27.2 arm64; Homebrew lame 4.0 already installed (no new install), sox 14.4.2_6 and ffmpeg 9.0.2_1 for the tone and checks; each step run as a fixed command string by a recording runner in an empty folder; self-made tone only, no network, no account), and all passed. The final Next step is advice and was not run. No independent check has been reviewed. This is the operator's own run, not a vendor claim.

Independent check

Independent check: not yet reviewed. (Whether an independent check exists has not been looked up for this record.)

Description

LAME is a command-line MP3 encoder. lame -b sets a constant bit rate, -V 0 to 9 a variable bit rate quality and -q the encoder effort; one option writes a WAV file from an MP3, and "-" reads from stdin or writes to stdout. It keeps the sample rate and channels of the input unless a low bit rate makes it lower the sample rate, which it reports on stderr. It reads WAV and, with --mp3input, MP3; in the test it did not read FLAC or MP4 files.

Current lesson

Goal: Make a 2-second stereo test tone, encode it to MP3 at a constant bit rate, at a VBR quality and with the slowest quality setting, read rate, channels and duration, decode one back to WAV and see a low bit rate change the sample rate.

This is the current lesson. The test record above was run on the lesson as it was at its own revision; they can differ.

  • 1. lame --version
  • 2. sox -n -r 44100 -c 2 -b 16 tone.wav synth 2 sine 440 sine 660
  • 3. lame -b 128 tone.wav cbr.mp3
  • 4. lame -V 2 tone.wav vbr.mp3
  • 5. lame -q 0 -b 192 tone.wav hq.mp3
  • 6. for f in cbr.mp3 vbr.mp3 hq.mp3; do echo "$f $(ffprobe -v error -show_entries stream=sample_rate,channels,bit_rate:format=duration -of compact=p=0 $f | tr '\n' ' ')"; done
  • 7. lame --decode vbr.mp3 back.wav
  • 8. echo "$(soxi -D back.wav) $(soxi -r back.wav) $(soxi -c back.wav) $(soxi -s back.wav)"
  • 9. lame -b 32 tone.wav low.mp3 && soxi -r low.mp3

Next (advice, not tested): Next: Agree with the user on the input copy, the output name and the bit rate or -V setting; encode to a new file name, then compare sample rate, channels and duration of the output with the input using ffprobe or soxi before deleting or replacing anything.

Cautions recorded with the lesson

These notes come from the lesson. Some describe failures seen in tests; others are general cautions. Each one is not a separately tested result.

  • Homebrew installs lame as a dependency of ffmpeg and sox, so it may already be present. The lesson uses sox only to make the tone and soxi and ffprobe only to read the results; lame itself needs neither.
  • lame --version prints the version and the license text and exits 0. Encoding prints progress and, for -V, a bit-rate histogram on stderr even when it succeeds.
  • A low bit rate resamples without asking: on a stereo 44.1 kHz tone, -b 32 gave 16 kHz and -b 64 gave 24 kHz (stderr: Resampling: input 44.1 kHz output 16 kHz). A mono 44.1 kHz tone at -b 64 stayed 44.1 kHz, and --resample 22.05 set the rate explicitly. Check the output sample rate.
  • -m m turned a stereo input into a mono MP3 (stderr: Autoconverting from stereo to mono).
  • -q changes the encoder effort, not the size, at a fixed bit rate. At -b 128, -q 0 and -q 9 gave files of the same size (33,017 bytes) with different bytes; -q 0 took about 0.13 s and -q 9 about 0.03 s for 2 s of audio. The same command run twice gave identical files.
  • Duration depends on the reader. For a 2 s source, ffprobe reported 2.000 s for the CBR and VBR files at 44.1 and 48 kHz, soxi reported 2.063 s for CBR and 2.037 s for VBR, and lame --decode removed the encoder delay and padding to give exactly 88,200 samples (96,000 at 48 kHz). Compare lengths with a tolerance or after decoding.
  • An MP3 written to stdout (lame -b 128 tone.wav -) did not keep the 2 s length. ffprobe reported 2.0375 s and --decode gave 89,327 samples instead of 88,200 (only the start delay was removed; the cause was not checked). The 16 kHz file from -b 32 also decoded to 32,879 samples (2.055 s), with only the start delay removed. Write to a file, and decode it to check, when the length must match.
  • An existing output file was replaced without asking (exit 0). The same name for input and output was refused with "Input file and Output file are the same. Abort." (exit 255) and the file was unchanged.
  • Failures exit 255 and leave no output file: a missing input (Could not find), a text file named .wav, a FLAC file and an MP4 file with audio (Warning: unsupported audio format), and a missing output folder (Can't init outfile). Make a WAV with sox or ffmpeg first.
  • --decode given a WAV instead of an MP3 still exits 0 and writes a WAV with the same samples, so exit 0 does not prove the input was an MP3.
  • Without an output name, lame x.wav writes x.mp3 next to the input. --mp3input re-encodes an MP3 input. --tt, --ta, --tl and --ty wrote the ID3 title, artist, album and date that ffprobe read back.
  • Confirm: Exit 0 does not prove the output is what was asked for (the resampling and stdout cases above). Read the sample rate, channels and duration of the result with ffprobe or soxi before deleting or replacing anything.

How to start

Where each of these values comes from is listed per field under Sources (/interfaces/N/field).

Compared facts

Values are shown as recorded; the source, check date and certainty of each value are under Sources. unknown means not confirmed, not "no".

Sources: 40 fields from 2 sources (JSON pointers into the .json version)

Each line names fields of this page (as JSON pointers into the .json version) and where they come from. Labels without a link are non-public sources. Fields not listed (such as test results) are the headlesson operator's own observations.

  • /name, /description, /lesson/steps/0, /lesson/steps/1, /lesson/steps/2, /lesson/steps/3, /lesson/steps/4, /lesson/steps/5, /lesson/steps/6, /lesson/steps/7, /lesson/steps/8, /lesson/cautions/items/1, /lesson/cautions/items/2, /lesson/cautions/items/3, /lesson/cautions/items/4, /lesson/cautions/items/5, /lesson/cautions/items/6, /lesson/cautions/items/7, /lesson/cautions/items/8, /lesson/cautions/items/9, /lesson/cautions/items/10, /interfaces/0/kind, /interfaces/0/name, /interfaces/0/install, /interfaces/0/verify, /interfaces/0/docs, /axes/license, /axes/open_source, /axes/cli: headlesson editorial judgement (checked 2026-11-15, primary, editorial)
  • /one_liner, /lesson/goal, /lesson/next_advice, /lesson/cautions/items/0, /lesson/cautions/items/11, /interfaces/0/auth, /axes/pricing, /axes/has_human_gui, /axes/non_interactive, /axes/auth, /axes/self_hostable: headlesson editorial judgement (checked 2026-11-15, inferred, editorial)

Primary record

Test results here are the operator's own past lesson trials (legacy). They are not claimed to meet level L1 of run-task-contract/0.1.0.

What "legacy" and L1 mean, and why this record does not claim L1: Record levels and labels.

Relations

  • None published yet.

2 other relations point to records that are not published yet.

Retrieve over MCP

headlesson_get id="app:lame" sections ["lesson","gotchas"] on https://mcp.headlesson.com/mcp

Cite

headlesson app:lame: see test record test:sazpyyu (https://headlesson.com/tests/sazpyyu).

Page updated: 2026-11-17 (the date its content last changed).

要約(日本語): LAME。運営の試用(2026-11-15、4.0、passed)の記録がある。詳しい条件・限界・出典は本文のとおり。