Skip to content

Add German language support via espeak-ng (lang_code 'de') — addresses #290#340

Open
chiddekel wants to merge 1 commit into
hexgrad:mainfrom
chiddekel:feat/german-espeak
Open

Add German language support via espeak-ng (lang_code 'de') — addresses #290#340
chiddekel wants to merge 1 commit into
hexgrad:mainfrom
chiddekel:feat/german-espeak

Conversation

@chiddekel

Copy link
Copy Markdown

German language support via espeak-ng (lang_code='de' / 'd')

Closes the practical gap behind #290: Kokoro had no German entry in its language table, even though it already drives Spanish, French, Italian, Portuguese and Hindi through espeak.EspeakG2P, and espeak-ng ships German out of the box. German just needed to join that family.

This is the pragmatic path @kneo described in #290"provided the correct phonemes, existing models may just work": espeak-ng produces correct German IPA, and the multilingual checkpoint consumes IPA.

Change (3 lines, no new dependency)

ALIASES   += {'de': 'd'}
LANG_CODES += {'d': 'de'}   # under the espeak-ng group
languages += ['d']          # CLI

The existing else branch then constructs EspeakG2P(language='de') automatically — no new code branch. espeak-ng is already required (it backs the English G2P fallback and every other espeak language), so there is nothing new to install.

Usage

from kokoro import KPipeline
pipe = KPipeline(lang_code='de')   # 'd' also works
python3 -m kokoro -l d --text "Guten Tag, wie geht es dir?"

Verified

"Guten Tag, wie geht es dir? Künstliche Intelligenz ist faszinierend."
→ ɡˈuːtən tˈɑːk, viː ɡˈeːt ɛs dˈiːɾ? kˈynstlɪçə ˌɪntəlɪɡˈɛnʦ ɪst fˌasʦiːnˈiːrənt.

Relationship to #317

#317 routes German to from misaki import de; de.DEG2P(), but misaki[de] does not exist on PyPI, so that path raises ImportError for every user today. This PR uses the already-working espeak path instead, so German works immediately.

Scope (honest)

Same tier and caveats as the other espeak languages: chunking isn't implemented for non-English (split long text on \n), and prosody quality varies because the base checkpoint wasn't fine-tuned on German. This is a working out-of-the-box German path now, complementary to a future dedicated misaki[de] / German fine-tune (the larger goal the #290 bounty funds).

Addresses #290

Routes German through the existing espeak.EspeakG2P path already used for
Spanish, French, Italian, Portuguese and Hindi -- German was simply
missing from ALIASES/LANG_CODES. No new code branch and no new
dependency: espeak-ng is already required (it backs en G2P fallback and
the other espeak languages) and ships German out of the box.

Usage:
    KPipeline(lang_code='de')   # or 'd'
    python3 -m kokoro -l d --text 'Guten Tag'

Verified: 'Guten Tag, wie geht es dir? Kuenstliche Intelligenz ist
faszinierend.' phonemizes to
['gutn tak, vi get s dir? kynstl ntlgnts st fastsinirnt.'] (IPA).

Scope note: this enables German G2P + synthesis via the shared multilingual
checkpoint, same tier/caveats as the other espeak languages (chunking not
yet implemented for non-English; intonation quality varies as the base
model was not fine-tuned on German). It is a working out-of-the-box path
toward hexgrad#290 while a dedicated misaki[de] / German fine-tune lands.

Addresses hexgrad#290
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant