From 92d74e1eaeafcef2ebd891ea0c7eabf748af3ffd Mon Sep 17 00:00:00 2001 From: Haydar061 Date: Sat, 4 Jul 2026 21:21:56 +0300 Subject: [PATCH] feat: add German language support via espeak-ng Add lang_code='d' (alias 'de') for German text-to-speech using the existing EspeakG2P pipeline with sentence-boundary chunking. - pipeline.py: add 'de' -> 'd' alias and 'd' -> 'de' LANG_CODE - __main__.py: expose 'd' in the CLI --language choices - Remove outdated warning that claimed chunking was not implemented; the __call__ method already handles non-English chunking Usage: pipeline = KPipeline(lang_code='d') # or lang_code='de' for result in pipeline('Guten Morgen', voice='...'): ... python3 -m kokoro -l d --voice df_... -o out.wav Closes #290 --- kokoro/__main__.py | 1 + kokoro/pipeline.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/kokoro/__main__.py b/kokoro/__main__.py index 34ee21a3..d84fd385 100644 --- a/kokoro/__main__.py +++ b/kokoro/__main__.py @@ -23,6 +23,7 @@ languages = [ "a", # American English "b", # British English + "d", # German "h", # Hindi "e", # Spanish "f", # French diff --git a/kokoro/pipeline.py b/kokoro/pipeline.py index 33770691..846d1f79 100644 --- a/kokoro/pipeline.py +++ b/kokoro/pipeline.py @@ -11,6 +11,7 @@ ALIASES = { 'en-us': 'a', 'en-gb': 'b', + 'de': 'd', 'es': 'e', 'fr-fr': 'f', 'hi': 'h', @@ -26,6 +27,7 @@ b='British English', # espeak-ng + d='de', e='es', f='fr-fr', h='hi', @@ -140,7 +142,7 @@ def __init__( raise else: language = LANG_CODES[lang_code] - logger.warning(f"Using EspeakG2P(language='{language}'). Chunking logic not yet implemented, so long texts may be truncated unless you split them with '\\n'.") + logger.debug(f"Using EspeakG2P(language='{language}') with sentence-boundary chunking.") self.g2p = espeak.EspeakG2P(language=language) def load_single_voice(self, voice: str):