feat: add multilingual TTS support via ephone (eSpeak-NG WASM)#313
Open
Dongshan-git wants to merge 1 commit into
Open
feat: add multilingual TTS support via ephone (eSpeak-NG WASM)#313Dongshan-git wants to merge 1 commit into
Dongshan-git wants to merge 1 commit into
Conversation
Replace the English-only `phonemizer` package with `ephone` v1.0.2, an eSpeak-NG WASM wrapper that ships language packs for 9 languages. Fix a hang in `KokoroTTS.stream()` where `splitter.close()` was never called, leaving the async iterator blocked forever. - phonemize.js: rewrite around `createEphone`; lazy-load the large Hindi 'all' pack on demand; skip English-specific r→ɹ for romance langs - kokoro.js: call `splitter.close()` after pushing chunks; await tokenizer - voices.js: uncomment all non-English voices (ja/zh/es/fr/hi/it/pt-br) - rollup.config.js: switch web build to dir+chunkFileNames for dynamic imports - demo: redesign UI with grouped voice selector, waveform player, per-language example texts, and AnimatePresence transitions Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Author
|
Also bumps |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
phonemizerpackage withephonev1.0.2, an eSpeak-NG WASM wrapper with built-in language packs for 9 languages (en-US, en-GB, es, fr, it, pt-BR, ja, zh, hi)KokoroTTS.stream()wheresplitter.close()was never called, leaving the async iterator blocked forever after all chunks were pushedvoices.js(Japanese, Chinese, Spanish, French, Hindi, Italian, Portuguese)Changes
src/phonemize.jscreateEphonefrom theephonepackageen_us,en_all,roa,jpx,sit) are imported as static top-level imports; Hindi's largeallpack is lazy-loaded on demandnormalize_textnow takes anenglishflag — number/currency/abbreviation normalization is skipped for non-English inputr → ɹ, kokoro pronunciation fix) is gated behindisEnglishso it doesn't corrupt romance-language phonemessrc/kokoro.jssplitter.close()call aftersplitter.push(...chunks)— without this theTextSplitterStreamasync iterator never resolvesthis.tokenizer(...)(was missingawait, causing silent failures)_validate_voicelanguage type annotation to cover all 9 language codessrc/voices.jsrollup.config.jsfile: "kokoro.web.js"todir + entryFileNames/chunkFileNamesto support dynamic imports (ephone language packs are code-split chunks)demo/WaveformPlayercomponent with canvas waveform visualizationAnimatePresenceloading/result transitionsTest plan
vitest— all phonemize tests should pass🤖 Generated with Claude Code