# LAME 3.100 corresponding source and relinking materials

The MP3 encoder is a standalone, encoder-only WebAssembly module, built with
Emscripten 4.0.10. LAME encoder and the FormatPlease C bridge are licensed under
LGPL-2.0-or-later (GNU Library GPL v2, or any later version). No upstream changes. The legacy configure script uses an i686 host triplet only
to select cross-compilation; emcc still emits wasm32, not x86 machine code.
Copyright notices, COPYING, LICENSE and individual file notices are
preserved in the complete, unmodified upstream source archive. The archive also
contains GPL decoder/frontend source that is **not linked into the delivered module**.
See the link map and `--disable-decoder --disable-frontend` configuration.

Downloads are at `/licenses/audio-sources/`: `lame-build.json`, `lame.c`,
`build-lame.py`, `relink-lame.py`, and `lame/` containing the upstream tarball,
`libmp3lame.a`, `lame-bridge.o`, `config.h`, `config.log`, and this README.
`lame-compliance.tar.gz` contains all these materials, notices, the JS loader,
WASM and link map. No written offer or third-party-only source link is relied on.

## Rebuild the library or bridge

Install Emscripten 4.0.10 from https://github.com/emscripten-core/emsdk
(`./emsdk install 4.0.10`, `./emsdk activate 4.0.10`, source `emsdk_env.sh`).
Install Python 3 and GNU make. Extract `lame/lame-3.100.tar.gz`. In the extracted
directory run (the full recorded flags are also in `lame-build.json`):

```sh
emconfigure ./configure --host=i686-unknown-linux-gnu --disable-shared --enable-static --disable-decoder --disable-frontend --disable-analyzer-hooks --disable-gtktest --disable-nasm CFLAGS=-O2
make -C libmp3lame -j2
cp libmp3lame/.libs/libmp3lame.a /path/to/materials/lame/libmp3lame.a
emcc -O2 -c /path/to/materials/lame.c -Iinclude -o /path/to/materials/lame/lame-bridge.o
```

You may change LAME or the bridge and repeat these steps. The included `.o` and
`.a` also permit relinking without rebuilding. From the downloaded materials:

```sh
python3 relink-lame.py --materials ./lame --output ./replacement/lame-core.js
```

## Use a modified module

Serve a local checkout of FormatPlease. After `pnpm build`, replace
`dist/audio-assets/1.0.0/lame-core.js` and `.wasm` with your rebuilt pair, then
serve that dist using `pnpm preview:ads` (local Wrangler). The worker imports
these same-origin assets without signature or integrity restrictions. For `pnpm dev`,
replace the pair in `public/audio-assets/1.0.0/` after the prepare step.
The regular build intentionally checks upstream release hashes; it must not be
run after replacement unless you update the local manifest/allowlist for your fork.
No private keys or paid services are needed. The modified module can be tested by
converting a WAV to MP3; the integration tests also exercise a relinked module.

FormatPlease permits modification of this combined encoder module for your own
use and reverse engineering for debugging such modifications, as required by
LGPL section 6. No site term is intended to restrict those rights. There is no
warranty. This permission concerns the module; it does not change unrelated
application licenses. Preserve LGPL notices and supply corresponding source and
relinking materials when redistributing the module, including modifications.

Technical delivery implements the source/object-code route in LGPL v2 section 6(a).
Legal review must still confirm the final deployed distribution and site terms,
source availability for every deployed version, and jurisdiction-specific patent
issues. Automated checks are technical evidence, not a legal opinion.
