kokoro_language (tts/factory.py)

projectBEA · src/modules/tts/factory.py · python · MIT
voice, Voice / Speech

The one place that knows how to build a voice. Same shape as `avatar/factory.py` and `llm/factory.py`. It exists because the engine was not the only thing that needed to build one: the diagnostic has to build the *same* voice the engine would, or it is testing something else. Whi

# Source: https://github.com/emqnuele/projectBEA | License: MIT | Copyright 2026 Emanuele Faraci
# Provided via justclaw.it.com; keep this notice with the code.
"""The one place that knows how to build a voice.

Same shape as `avatar/factory.py` and `llm/factory.py`. It exists because the
engine was not the only thing that needed to build one: the diagnostic has to
build the *same* voice the engine would, or it is testing something else.

Which voice that is comes from `providers.voice_for`, not from each builder
reading its own field: the language policy lives in one place, and a builder is
only the two or three lines that hand an engine what it needs.

Imports live inside the builders, so choosing EdgeTTS never pays for loading
onnxruntime.
"""

from typing import Callable, Dict

from sr

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key