MeloTTS-Korean's symbol vocab only includes precomposed Hangul
syllables. Bare Hangul Compatibility Jamo characters (ㅋㅋㅋ, ㅠㅠ, ㅎㅎ)
and Hangul Jamo block code points blow up in
`cleaned_text_to_sequence` with `KeyError: 'ㅋ'` (or similar).
Pre-clean the request text in `/tts` to drop those code point ranges
before handing the string to the model, collapsing the leftover
whitespace. If sanitization yields an empty string, return 400 with
an explanation instead of a 500 stack trace.
Also document the limitation in the README troubleshooting section.
`model.hps.data.spk2id` is a MeloTTS `HParams` instance, not a dict.
It exposes `__contains__` and `__getitem__` but not `.get()`, so the
previous lookup blew up at lifespan startup with
`AttributeError: 'HParams' object has no attribute 'get'`.
Switch to `spk["KR"] if "KR" in spk else next(iter(spk.values()))`.
melo-test/ contains a minimal FastAPI server + static HTML UI for
auditioning MeloTTS-Korean before wiring it into the bot:
- server.py: POST /tts -> wav, model loaded once at startup
- index.html: textarea + presets + audio player, shows synth latency
- requirements.txt / README.md: setup steps
Directory is melo-test/ because the repo .gitignore already excludes
test/. Discord-bot integration is unchanged in this branch; this is a
local audition harness only.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>