Custom/community voices (GLaDOS) and multi-speaker support #23

Open
opened 2026-10-25 16:20:02 +00:00 by dsh · 1 comment
Owner

Goal

Let a user add a Piper-format ONNX voice the official catalog does not ship — GLaDOS — and pick a speaker for multi-speaker models. This is the path to the operator's requested GLaDOS default without this repo redistributing a fan model of a copyrighted character. Pulled forward to M2 (operator, 2026-10-25).

Verified sources (2026-10-25)

GLaDOS — usable

  • Repo: DavesArmoury/GLaDOS_TTS, licence CC BY 4.0 (attribution required), piper-format model trained by the author.
  • Model: https://huggingface.co/DavesArmoury/GLaDOS_TTS/resolve/main/glados_piper_medium.onnx — 63,511,038 bytes, sha256 b35a07fa6fc788ec4ad637ec98b74d66f06e664bbb4366b4035d1deaac3308d3.
  • Config: .../glados_piper_medium.onnx.json — 7,089 bytes, sha256 77a103377c971e87bfac6a839beb0de95433f38acf1fb92c201dcdc72862f422; sample_rate 22050, phoneme_type espeak, espeak.voice en-us, num_symbols 256, num_speakers 1, phoneme map present. Standard VITS/Piper.
  • CORS: HF resolve returns access-control-allow-origin: * on the final response — browser fetch works.
  • Alternative systemofapwne/piper-en_US-glados-high: no licence field, files are model.onnx + config.json (not piper .onnx.json) — do not use without the operator confirming licence/shape.
  • Character rights: GLaDOS is a copyrighted character; CC BY covers the model author's contribution, not the character. We never bundle or mirror the file — the browser fetches it from the original repo at the user's request, with attribution shown.

"Ritts"

The supplied en_GB-ritts-medium path does not exist. Operator decision: ship the real British catalogue voices instead — en_GB-alan-medium, en_GB-alba-medium, en_GB-cori-medium (single speaker), plus en_GB-semaine-medium (4 speakers) and en_GB-vctk-medium (109 speakers). LibriTTS is not in scope unless asked later.

Technical blocker (verified in the packages)

Both @mintplex-labs/piper-tts-web@1.0.5 and @realtimex/piper-tts-web@1.1.1 hardcode the model host and a voice map:

const HF_BASE = "https://huggingface.co/diffusionstudio/piper-voices/resolve/main";
// PATH_MAP[voiceId] -> "en/en_US/.../x.onnx"; unknown id => throw "Voice ID ... not found in PATH_MAP"

(piper-tts-web.js:13,17 mintplex; :13,294-296 realtimex.) They also hardcode speakerId = 0 (:388 / :342), so no speaker picker. A custom voice cannot be passed to either library as-is — the custom-voice work must include the direct ONNX path.

Scope

  • Direct ONNX path: load the .onnx + .onnx.json from arbitrary pinned URLs, phonemize with piper_phonemize wasm (the package exports createPiperPhonemize), run onnxruntime-web (pinned 1.18.x), produce PCM/WAV. This is also the fork-death mitigation for #10.
  • Custom voice import: URL + optional sha256 for model and config; validate config fields (sample_rate, phoneme_type, num_symbols, num_speakers, phoneme map); cache in OPFS; "custom" badge; delete.
  • GLaDOS preset (not a hidden download): listed by name with attribution "GLaDOS voice by DavesArmoury (CC BY 4.0)", explicit download button, checksum above; fetched from the original HF repo, never bundled.
  • Speaker picker for num_speakers > 1; persist the choice. Needed for en_GB-semaine-medium (4) and en_GB-vctk-medium (109), and it unlocks libritts later.
  • Licence UX: one-line warning that the user is responsible for the model licence and voice rights; no mirroring.
  • Tests: config validation, checksum mismatch, speaker-id plumbing, cache round-trip.

Acceptance

  • GLaDOS downloads with progress, checksum verified, speaks the preview line, and can be set as the default voice in settings — nothing redistributed by this repo or npm package.
  • A multi-speaker catalog voice (semaine/vctk) lets the user pick a speaker and hears the difference.
  • Malformed config / checksum mismatch / 404 → clear error, no crash.

Notes

  • Depends on #10, #12. Part of M2. The five British catalogue voices can ship in #12 before this lands; semaine/vctk sound like speaker 0 until the picker here exists.
## Goal Let a user add a Piper-format ONNX voice the official catalog does not ship — **GLaDOS** — and pick a speaker for multi-speaker models. This is the path to the operator's requested GLaDOS default without this repo redistributing a fan model of a copyrighted character. **Pulled forward to M2** (operator, 2026-10-25). ## Verified sources (2026-10-25) ### GLaDOS — usable - Repo: `DavesArmoury/GLaDOS_TTS`, licence **CC BY 4.0** (attribution required), piper-format model trained by the author. - Model: `https://huggingface.co/DavesArmoury/GLaDOS_TTS/resolve/main/glados_piper_medium.onnx` — **63,511,038 bytes**, sha256 `b35a07fa6fc788ec4ad637ec98b74d66f06e664bbb4366b4035d1deaac3308d3`. - Config: `.../glados_piper_medium.onnx.json` — 7,089 bytes, sha256 `77a103377c971e87bfac6a839beb0de95433f38acf1fb92c201dcdc72862f422`; `sample_rate 22050`, `phoneme_type espeak`, `espeak.voice en-us`, `num_symbols 256`, `num_speakers 1`, phoneme map present. Standard VITS/Piper. - CORS: HF `resolve` returns `access-control-allow-origin: *` on the final response — browser fetch works. - Alternative `systemofapwne/piper-en_US-glados-high`: **no licence field**, files are `model.onnx` + `config.json` (not piper `.onnx.json`) — do **not** use without the operator confirming licence/shape. - Character rights: GLaDOS is a copyrighted character; CC BY covers the model author's contribution, not the character. We never bundle or mirror the file — the browser fetches it from the original repo at the user's request, with attribution shown. ### "Ritts" The supplied `en_GB-ritts-medium` path does **not exist**. Operator decision: ship the **real British catalogue voices** instead — `en_GB-alan-medium`, `en_GB-alba-medium`, `en_GB-cori-medium` (single speaker), plus `en_GB-semaine-medium` (4 speakers) and `en_GB-vctk-medium` (109 speakers). LibriTTS is **not** in scope unless asked later. ## Technical blocker (verified in the packages) Both `@mintplex-labs/piper-tts-web@1.0.5` and `@realtimex/piper-tts-web@1.1.1` hardcode the model host and a voice map: ```js const HF_BASE = "https://huggingface.co/diffusionstudio/piper-voices/resolve/main"; // PATH_MAP[voiceId] -> "en/en_US/.../x.onnx"; unknown id => throw "Voice ID ... not found in PATH_MAP" ``` (`piper-tts-web.js:13,17` mintplex; `:13,294-296` realtimex.) They also hardcode `speakerId = 0` (`:388` / `:342`), so no speaker picker. **A custom voice cannot be passed to either library as-is** — the custom-voice work must include the direct ONNX path. ## Scope - [ ] **Direct ONNX path**: load the `.onnx` + `.onnx.json` from arbitrary pinned URLs, phonemize with `piper_phonemize` wasm (the package exports `createPiperPhonemize`), run `onnxruntime-web` (pinned 1.18.x), produce PCM/WAV. This is also the fork-death mitigation for #10. - [ ] **Custom voice import**: URL + optional sha256 for model and config; validate config fields (`sample_rate`, `phoneme_type`, `num_symbols`, `num_speakers`, phoneme map); cache in OPFS; "custom" badge; delete. - [ ] **GLaDOS preset** (not a hidden download): listed by name with attribution "GLaDOS voice by DavesArmoury (CC BY 4.0)", explicit download button, checksum above; fetched from the original HF repo, never bundled. - [ ] **Speaker picker** for `num_speakers > 1`; persist the choice. Needed for `en_GB-semaine-medium` (4) and `en_GB-vctk-medium` (109), and it unlocks libritts later. - [ ] Licence UX: one-line warning that the user is responsible for the model licence and voice rights; no mirroring. - [ ] Tests: config validation, checksum mismatch, speaker-id plumbing, cache round-trip. ## Acceptance - GLaDOS downloads with progress, checksum verified, speaks the preview line, and can be set as the default voice in settings — nothing redistributed by this repo or npm package. - A multi-speaker catalog voice (semaine/vctk) lets the user pick a speaker and hears the difference. - Malformed config / checksum mismatch / 404 → clear error, no crash. ## Notes - Depends on #10, #12. **Part of M2.** The five British catalogue voices can ship in #12 before this lands; semaine/vctk sound like speaker 0 until the picker here exists.
Author
Owner

GLaDOS + LibriTTS (Ritts) implemented in e21dbb6, awaiting the operator's browser test.

  • Build-time patch for the pinned piper-tts-web@1.0.5: custom model/config URLs, per-voice OPFS names, and __PIPER_SPEAKER_ID__ instead of hardcoded speaker 0. Every replacement is asserted, so a version bump fails the build.
  • Catalogued: GLaDOS high (113.8 MB, pinned commit, sha256 recorded), LibriTTS-R medium (78.6 MB, 904 speakers), LibriTTS high (136.7 MB, 904 speakers).
  • Settings shows a Speaker number field for multi-speaker voices (0–903).
  • URLs pinned to HF commit SHAs; ONNX sha256 values recorded in piper-custom.js. Post-download hash verification is the next hardening step.
  • 152 tests.

Needed from operator: the numeric LibriTTS speaker id for “Layla Deeps” (0–903). The repo also ships samples/speaker_<n>.mp3; I can add a “preview this speaker” button so IDs can be auditioned.

**GLaDOS + LibriTTS (Ritts) implemented** in `e21dbb6`, awaiting the operator's browser test. - Build-time patch for the pinned `piper-tts-web@1.0.5`: custom model/config URLs, per-voice OPFS names, and `__PIPER_SPEAKER_ID__` instead of hardcoded speaker 0. Every replacement is asserted, so a version bump fails the build. - Catalogued: GLaDOS high (113.8 MB, pinned commit, sha256 recorded), LibriTTS-R medium (78.6 MB, 904 speakers), LibriTTS high (136.7 MB, 904 speakers). - Settings shows a **Speaker** number field for multi-speaker voices (0–903). - URLs pinned to HF commit SHAs; ONNX sha256 values recorded in `piper-custom.js`. Post-download hash verification is the next hardening step. - 152 tests. **Needed from operator:** the numeric LibriTTS speaker id for “Layla Deeps” (0–903). The repo also ships `samples/speaker_<n>.mp3`; I can add a “preview this speaker” button so IDs can be auditioned.
Sign in to join this conversation.
No description provided.