{
 "kind": "app",
 "id": "app:lame",
 "url": "https://headlesson.com/apps/lame",
 "name": "LAME",
 "one_liner": "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).",
 "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.",
 "made_by_headlesson_operator": false,
 "interfaces": [
  {
   "kind": "cli",
   "name": "lame (Homebrew bottle 4.0)",
   "install": "brew install lame",
   "verify": "lame --version",
   "auth": "None.",
   "docs": "https://lame.sourceforge.io/"
  }
 ],
 "tests": [
  {
   "record_id": "test:sazpyyu",
   "url": "https://headlesson.com/tests/sazpyyu",
   "date": "2026-11-15",
   "version": "4.0",
   "status": "passed"
  }
 ],
 "latest_test_conclusion": "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": {
  "state": "not_checked"
 },
 "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.",
  "steps": [
   "lame --version",
   "sox -n -r 44100 -c 2 -b 16 tone.wav synth 2 sine 440 sine 660",
   "lame -b 128 tone.wav cbr.mp3",
   "lame -V 2 tone.wav vbr.mp3",
   "lame -q 0 -b 192 tone.wav hq.mp3",
   "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",
   "lame --decode vbr.mp3 back.wav",
   "echo \"$(soxi -D back.wav) $(soxi -r back.wav) $(soxi -c back.wav) $(soxi -s back.wav)\"",
   "lame -b 32 tone.wav low.mp3 && soxi -r low.mp3"
  ],
  "next_advice": "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": {
   "note": "These notes come from the lesson. Some describe failures seen in tests; others are general cautions. Each one is not a separately tested result.",
   "items": [
    "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."
   ]
  },
  "note": "This is the current lesson. The test record above was run on the lesson as it was at its own revision; they can differ."
 },
 "mcp_get": "headlesson_get id=\"app:lame\" sections [\"lesson\",\"gotchas\"]",
 "axes": {
  "license": {
   "value": "LGPL-2.0-or-later",
   "checked": "2026-11-15",
   "certainty": "primary",
   "source": "headlesson editorial judgement",
   "by": "editorial"
  },
  "open_source": {
   "value": true,
   "checked": "2026-11-15",
   "certainty": "primary",
   "source": "headlesson editorial judgement",
   "by": "editorial"
  },
  "pricing": {
   "value": "free",
   "checked": "2026-11-15",
   "certainty": "inferred",
   "source": "headlesson editorial judgement",
   "by": "editorial"
  },
  "has_human_gui": {
   "value": "none",
   "checked": "2026-11-15",
   "certainty": "inferred",
   "source": "headlesson editorial judgement",
   "by": "editorial"
  },
  "non_interactive": {
   "value": true,
   "checked": "2026-11-15",
   "certainty": "inferred",
   "source": "headlesson editorial judgement",
   "by": "editorial"
  },
  "machine_output": {
   "value": "unknown",
   "checked": null,
   "certainty": null,
   "source": null,
   "by": null
  },
  "local_mcp": {
   "value": "unknown",
   "checked": null,
   "certainty": null,
   "source": null,
   "by": null
  },
  "remote_mcp": {
   "value": "unknown",
   "checked": null,
   "certainty": null,
   "source": null,
   "by": null
  },
  "cli": {
   "value": true,
   "checked": "2026-11-15",
   "certainty": "primary",
   "source": "headlesson editorial judgement",
   "by": "editorial"
  },
  "rest_api": {
   "value": "unknown",
   "checked": null,
   "certainty": null,
   "source": null,
   "by": null
  },
  "auth": {
   "value": "none",
   "checked": "2026-11-15",
   "certainty": "inferred",
   "source": "headlesson editorial judgement",
   "by": "editorial"
  },
  "self_hostable": {
   "value": true,
   "checked": "2026-11-15",
   "certainty": "inferred",
   "source": "headlesson editorial judgement",
   "by": "editorial"
  },
  "embeds_llm": {
   "value": "unknown",
   "checked": null,
   "certainty": null,
   "source": null,
   "by": null
  },
  "refusal_contract": {
   "value": "unknown",
   "checked": null,
   "certainty": null,
   "source": null,
   "by": null
  },
  "audit_log": {
   "value": "unknown",
   "checked": null,
   "certainty": null,
   "source": null,
   "by": null
  },
  "last_release": {
   "value": "unknown",
   "checked": null,
   "certainty": null,
   "source": null,
   "by": null
  },
  "ja_support": {
   "value": "unknown",
   "checked": null,
   "certainty": null,
   "source": null,
   "by": null
  }
 },
 "sources": [
  {
   "fields": [
    "/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"
   ],
   "source": "headlesson editorial judgement",
   "checked": "2026-11-15",
   "certainty": "primary",
   "by": "editorial"
  },
  {
   "fields": [
    "/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"
   ],
   "source": "headlesson editorial judgement",
   "checked": "2026-11-15",
   "certainty": "inferred",
   "by": "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.",
 "relations": [],
 "relations_not_published": 2,
 "cite": "headlesson app:lame: see test record test:sazpyyu (https://headlesson.com/tests/sazpyyu).",
 "page_updated": "2026-11-17"
}
