# lamejs Replacement Instructions

HIM Scale Builder loads the LGPL-covered MP3 encoder as a separate runtime file:

`/vendor/lamejs/1.2.1/lame.min.js`

The proprietary application bundle does not merge the encoder into the main Vite bundle. The MP3 encoder worker loads the file with `importScripts()` and uses the public `lamejs.Mp3Encoder` interface.

## Included component

- Package: `lamejs`
- Version: `1.2.1`
- License: GNU LGPL version 3
- Distributed file: `public/vendor/lamejs/1.2.1/lame.min.js`
- Corresponding source package: `public/legal/sources/lamejs-1.2.1-source.zip`
- Hash manifest: `public/legal/LAMEJS_SHA256SUMS.txt`

The distributed runtime file matches the installed upstream `lamejs@1.2.1` package file byte-for-byte.

## Replacement process

1. Obtain the corresponding source from `public/legal/sources/lamejs-1.2.1-source.zip`.
2. Modify or rebuild an interface-compatible JavaScript file that exposes `lamejs.Mp3Encoder` in the worker global scope.
3. Replace `public/vendor/lamejs/1.2.1/lame.min.js` with the compatible replacement file.
4. Run the local build:

   ```text
   npm.cmd run build
   ```

5. Run the audio-export verifier:

   ```text
   npm.cmd run verify:audio-export
   ```

6. Confirm the MP3 encoder worker still loads the separate runtime path and produces an MP3 export from the app.

If the replacement intentionally changes the vendor file bytes, update any local hash checks used for your modified copy. Do not describe that modified file as the unmodified upstream `lamejs@1.2.1` runtime file.

Human Instrument Method terms do not prohibit reverse engineering solely for debugging modifications to this LGPL-covered MP3 encoder component.
