# Library source and replacement instructions

The archives in this directory preserve library code, original notices, and build inputs from the npm distributions and upstream source at the npm release gitHead for SoundTouchJS 0.3.0 and @breezystack/lamejs 1.2.7. The Bricolage Grotesque npm archive includes the unmodified font files and the authors' OFL notice. Audio/video examples are omitted; the exact omitted paths, original official download URLs, original npm integrity, and delivered archive byte sizes and SHA-256 hashes are recorded in manifest.json. No audio/video sample is served in these archives. Copyright notices in the original sources and licenses have been preserved. LGPL3 includes GPL3 terms; both full texts are supplied.

Song Slower permits modification of the LGPL library portions and reverse engineering to debug such modifications. Corresponding application source and build inputs are supplied in songslower-application-source.tar.gz specifically to let recipients rebuild and recombine this application with a modified, interface-compatible library.

## Reproduce the application

1. Install Node.js and npm and extract songslower-application-source.tar.gz into a new directory.
2. Run npm ci. This installs the exact versions in package-lock.json.
3. Run npm run build, then npm start. Open http://127.0.0.1:4178/. The build output is site/.

## Replace SoundTouchJS

1. Extract soundtouchjs/soundtouchjs-0.3.0-source-no-media.tar.gz. Modify its src files as needed. Preserve notices and comply with its LGPL license.
2. In that extracted library directory, run npm install and npm run build. Its scripts/rollup.config.mjs creates dist/soundtouch.js.
3. In the extracted application directory, run npm install --no-save --package-lock=false <absolute-path-to-the-modified-library-directory>. This replaces the package while retaining the soundtouchjs import interface.
4. Run npm run build again. src/audio-worker.js is bundled with your replacement library into site/assets/audio-worker.js. Serve the new site/ with npm start.

## Replace lamejs

1. Extract lamejs/lamejs-1.2.7-source-no-media.tar.gz. Modify its src/js sources as needed. Preserve notices and comply with its LGPL license.
2. In that extracted library directory, run npm install and npm run build. The upstream Vite build creates dist/lamejs.js.
3. In the extracted application directory, run npm install --no-save --package-lock=false <absolute-path-to-the-modified-library-directory>. Keep the @breezystack/lamejs package name and exported Mp3Encoder interface.
4. Run npm run build again. src/mp3-worker.js is bundled with your replacement encoder into site/assets/mp3-worker.js. Serve the new site/ with npm start.

No remote service, signing key, or activation is needed to run a modified build. Browser input format support still depends on the browser's audio decoder. Sources and dependencies can also be obtained from the upstream URLs in manifest.json.
