Files
VoiceStudio/backend
Palash DebnathandClaude Opus 4.8 8cf3dad2f4 feat(gallery): multilingual designed-voice archetypes (#213)
* feat(gallery): multilingual designed-voice archetypes

Ship curated designed voices in 9 more languages (Spanish, French, German,
Italian, Portuguese, Russian, Hindi, Japanese, Korean) so the gallery offers
more than English + Chinese out of the box -- 27 new featured archetypes
across three reusable roles (Narrator / Explainer / Companion).

Voice-design timbre (gender/age/pitch) is language-independent, and a designed
voice's spoken language is driven by the preview text, not the instruct. So
these reuse a neutral instruct + a localized sample script + a `language` value
matching frontend/src/languages.json -- byte-for-byte the same
model.generate(text, language, instruct) call the Generate tab already makes.
They carry no accent/dialect token (accents are English-only, dialects
Chinese-only; an invented "spanish accent" would crash synthesis, the issue-#89
mode), so every instruct stays inside the validator vocabulary.

- backend/core/archetypes.py: _ML_SAMPLES + _ML_ROLES + _make_multilingual()
- frontend VoiceGallery: extend the language facet filter
- tests: assert the 9 languages are present, neutral-timbre, valid-token
- test_no_hardcoded_cjk: note JA/KO sample text in the existing allowlist entry

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(gallery): surface featured-only languages through the filter

Address review feedback (greptile/coderabbit) on #213:

- VoiceGallery: the Browse query hard-coded `featured: false` while the
  Featured strip is hidden whenever a filter is active. The 9 new languages
  have *only* featured archetypes, so selecting Spanish/French/etc. produced
  an empty Browse AND a hidden Featured strip -> "No voices match these
  filters" despite 3 archetypes existing per language. Now Browse includes
  featured exactly when the Featured strip is hidden (i.e. when filtering),
  with no duplication when nothing is filtered.
- archetypes.py: module docstring said the Featured tier was "~24"; it is now
  ~51 (24 English + 27 multilingual). Added a docstring to _make_multilingual().

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-01 08:37:29 +05:30
..