Kokoro German "Martin" β sherpa-onnx package
The German Kokoro voice Martin, repackaged so it loads and runs in sherpa-onnx for fully offline, on-device German text-to-speech.
This is a repackaging, not a retraining β the weights are untouched. The only changes are the metadata and file layout sherpa-onnx needs in order to load a Kokoro model at all.
Why the repackaging is needed
sherpa-onnx's Kokoro TTS reads its configuration out of the ONNX file's metadata (model type,
sample rate, speaker table, style dimensions, β¦) to know how to run the model, and it expects the
speaker style vectors as a single flat voices.bin. The upstream Martin export provides
neither β the ONNX carries no sherpa-onnx metadata, and the voice ships as a NumPy .npz β so
sherpa-onnx cannot load it directly. This package fixes exactly that:
- injects the sherpa-onnx Kokoro metadata into the ONNX (
model_type=kokoro,sample_rate=24000,style_dim=510,1,256,n_speakers=1,id2speaker=0->martin, β¦), copied from k2-fsa's own Kokoro release schema, and - converts the voice
.npz(one(510,1,256)float32 array) into the flat little-endianvoices.binsherpa expects (522 240 bytes).
The result loads and synthesizes in sherpa-onnx with the weights unchanged.
What's in the archive
kokoro-de-martin.tar.bz2:
model.onnxβ the Martin ONNX with sherpa-onnx Kokoro metadata injectedvoices.binβ the voice style vector (510Γ1Γ256 float32)tokens.txtβ from the k2-fsa sherpa-onnx Kokoro releaseespeak-ng-data/β from espeak-ng 1.52 (see the pronunciation note below)
Pronunciation notes (German G2P)
sherpa-onnx phonemizes German with espeak-ng / piper-phonemize, and two properties of that pipeline affect raw-text rendering. Both are properties of the sherpa-onnx Kokoro G2P, not of the voice weights.
ΚΙ("ur") vowel β fixed in this package. The espeak-ng-data shipped by k2-fsa's base Kokoro release is stale and emits a literal?for the vocalized-rΚΙ, sodurch,kurz,wurde, β¦ mispronounce. This package instead bundles current espeak-ng 1.52 data, which resolvesΚΙcorrectly (durchβdΛΚΙΓ§). A build-time check guards it.- ich-laut
/Γ§/β needs a phonemizer patch, not a lexicon. piper-phonemize NFD-decomposesΓ§intoc+ combining cedilla (U+0327), which the precomposed Kokoro token set drops, soich,nicht,-lich/-igdon't render cleanly. Note the usual "add a lexicon entry" workaround does not apply here: sherpa-onnx consults the Kokoro lexicon only for its dictionary languages (en/zh); for espeak-driven languages (incl. German) it goes straight to espeak and never reads the lexicon. The fix has to be in the phonemizer β recompose the pair back toΓ§when that codepoint is a known token. The Page Reader app that consumes this package carries exactly that patch in its bundled sherpa-onnx build; if you run this archive on stock sherpa-onnx, Γ§-words are still affected.
How it was built
Reproducibly, by a small build chain: fetch the upstream Martin ONNX + voice .npz and k2-fsa's
base Kokoro release (for the metadata schema, tokens.txt, and espeak-ng-data/), inject the
metadata, convert the .npz to voices.bin, and assemble the archive. A verify step then loads
the result in sherpa-onnx and synthesizes a German clip to confirm it works before publishing.
Provenance & license
Apache-2.0, inherited from upstream. The weights are unchanged from the source fine-tune:
- ONNX source: Godelaune/Kokoro-82M-ONNX-German-Martin
- Fine-tune: kikiri-tts/kikiri-german-martin (Martin Harbecke voice, StyleTTS2)
- Architecture: hexgrad/Kokoro-82M
tokens.txt+espeak-ng-data/: k2-fsa sherpa-onnx Kokoro release
Usage
Extract kokoro-de-martin.tar.bz2 and point sherpa-onnx's Kokoro config at model.onnx,
voices.bin, tokens.txt, and espeak-ng-data/ with lang=de.