# Vendored code

Served from this site; nothing is loaded from a CDN at runtime.

## lamejs 1.2.1 (MP3 encoder)

Copied unchanged from audio.gripe (`audio/public/vendor/lamejs/`); see `audio/public/vendor/VENDORED.md` for the full
provenance and checks.

- Package: [`lamejs`](https://www.npmjs.com/package/lamejs) **1.2.1**, from `https://registry.npmjs.org/lamejs/-/lamejs-1.2.1.tgz`.
- Source: https://github.com/zhuker/lamejs (a JavaScript port of jump3r, itself a port of [LAME](https://lame.sourceforge.io/)).
- License: **LGPL-3.0**. `lamejs/COPYING.LESSER` and `lamejs/COPYING` are the full LGPL v3 / GPL v3 texts;
  `lamejs/LICENSE` is the package's own note.
- `lamejs/lame.min.js` is the package's prebuilt browser build, **unmodified** (sha256
  `15d285e2587b3bdbfd18a68de6ce07cc074f7480a82c3815da2dc1c348ec6df4`). It is loaded on its own at runtime by
  `mp3-worker.js` (`importScripts`), so it stays a separate, replaceable library as the LGPL asks: swap in your own
  build at the same path.
- `mp3-worker.js` is audio.gripe's worker, unchanged.
- Acknowledgement and links are in the page footer.

## vo-aacenc AAC Huffman tables (data only)

- Source: https://github.com/mstorsjo/vo-aacenc at commit `a277487e051e92e99a532294eed3c673f4d879f2`, file
  `aacenc/src/aac_rom.c` (sha256 `bebae3b53f4de70055c6328a24e3fc3172f3b15d40eb9e4556d6d8c2d91cb8b6`).
  Copyright 2003-2010 VisualOn, Inc.
- License: **Apache License 2.0**. `vo-aacenc/LICENSE` is the repository's `COPYING` (the Apache 2.0 text);
  `vo-aacenc/NOTICE` is its NOTICE file.
- What's used: only the values of the 19 Huffman tables (the ISO/IEC 14496-3 spectral and scalefactor codebooks:
  code words and lengths), turned into `../aac-tables.js` by `ringtones/tools/make-aac-tables.py`, which checks each
  table's size. No vo-aacenc code is used.
- Checks: `aac-tables.js` has no network calls or email addresses; files made with it decode without errors in
  ffmpeg and Apple's AudioToolbox (`afconvert`, `afinfo`) at 44.1 and 48 kHz, mono and stereo
  (`ringtones/test/aac-roundtrip.mjs`).

## Not vendored

Everything else is this site's own code: `aacenc.js` (AAC-LC encoder: MDCT, masking estimate, quantization,
bitstream), `mux.js` (MP4/.m4r writer based on audio.gripe's, with an edit list and title tag; Ogg/Opus writer),
`core.js`, `app.js`, `aac-worker.js`, `index.html`.
