Benjamin Harris f5911fe75a Add microphone recording to MP3 on a /audio page 1 kuukausi sitten
..
src f5911fe75a Add microphone recording to MP3 on a /audio page 1 kuukausi sitten
COPYING f5911fe75a Add microphone recording to MP3 on a /audio page 1 kuukausi sitten
README.md f5911fe75a Add microphone recording to MP3 on a /audio page 1 kuukausi sitten
UPSTREAM_VERSION.txt f5911fe75a Add microphone recording to MP3 on a /audio page 1 kuukausi sitten
library.json f5911fe75a Add microphone recording to MP3 on a /audio page 1 kuukausi sitten

README.md

shine — fixed-point MP3 encoder

Vendored verbatim from toots/shine at commit ab5e3526 (2023-01-01). See UPSTREAM_VERSION.txt.

Treat this as third party, the same way lib/ST7305_U8g2/ is treated: fix bugs upstream-style and keep local changes minimal and commented. There are currently no local changes — src/ is a straight copy of upstream's src/lib/.

Why it is here

The ESP32-S3 has no hardware audio encoder, and raw 16-bit PCM from the ES7210 is 32 kB/s — about four minutes into the whole PSRAM heap. Shine is fixed-point and skips psychoacoustic analysis entirely, which is what makes real-time encoding possible on this part at all. It is the encoder the ESP32 audio community has settled on for exactly this reason.

Only the parts of upstream needed to build the library are copied: the autotools scripts, the JS/Android bindings and the command-line front end are all left behind. Shine needs no generated config.h, so it compiles as-is.

Sample rates

Upstream supports MPEG-2 LSF, so 16 kHz is a valid sample rate (tables.c lists 16000 under MPEG-II). Some older forks are MPEG-1 only, which is where the widely repeated "shine cannot go below 32 kHz" claim comes from. It does not apply to this copy.

Licence

Shine is LGPL-2.1, which is more restrictive than everything else in this repository. Statically linked into a firmware image, the LGPL's relinking obligation is only really satisfiable by publishing the object files or the source. That is not a problem for a personal device whose source is already public, but it is worth knowing before this firmware is distributed as a binary. COPYING is upstream's licence text, unmodified.