feat(audio): add downloadable extra Piper voices with accents

Adds Alma (sv), Alan, Northern English, Cori, Alba (British/Scottish)
and Joe, John, Norman (American) as optional voices downloaded one at
a time from Settings, with gender (measured pitch) and accent shown in
the voice lists. The standard install is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
larssand
2026-09-30 21:58:08 +02:00
parent aaca5e8c63
commit ebd0f74f40
15 changed files with 186 additions and 25 deletions

View File

@@ -237,7 +237,7 @@ Role:
Owns:
- voice catalog in `tts_install.js`: one male + one female voice per language with gender/label (genders measured by pitch, not guessed); `pickVoice` prefers the voice chosen in Settings, then the catalog default
- `tts.js`: finds the Piper binary (`RC_PIPER_BIN`, then `<project>/piper/`, then PATH, then `~/.local/bin`) and voices (`RC_PIPER_VOICES_DIR`, `data/piper-voices`, `<project>/piper/voices`, `~/.local/share/piper-voices`); generates one line at a time into a WAV cache under `data/tts/` keyed by voice + speed + text; dedupes identical in-flight requests; background pre-generation with progress
- `tts_install.js`: downloads the standalone Piper release for the OS and the `sv_SE-nst-medium` / `en_US-lessac-medium` voices into `<project>/piper/`, skipping anything present; used by both `npm run tts:install` (`scripts/install-piper.js`) and `POST /api/tts/install`
- `tts_install.js`: downloads the standalone Piper release for the OS and the standard voices (NST, Lisa, Ryan, Lessac) into `<project>/piper/`, skipping anything present. `extra` catalog voices (Alma, Alan, Northern English, Cori, Alba, Joe, John, Norman) are only fetched one at a time via `POST /api/tts/install { voice }`; `tts.status()` lists them as `downloadable` for the Settings panel. The catalog is used by both `npm run tts:install` (`scripts/install-piper.js`) and `POST /api/tts/install`
- routes in `server.js`: `GET /api/tts/status` (open), `POST /api/tts/speech`, `POST /api/tts/pregenerate`, `POST /api/tts/install` (all PIN-protected once a PIN is set)
### `scripts/record-video-guides.mjs` and `scripts/capture-screenshots.mjs`