# Current local EMA TTS backend This is an example local adapter for a text-to-speech workflow. Keep it separate from the model-agnostic pronunciation procedure in `SKILL.md` so another backend can be added without losing the lexicon. ## Speech preparation - A helper module (e.g. `/okunabilir.py`) exports `okunabilir(text)`. It is a Python helper, not a command-line program. - The synthesizer script (e.g. `/seslendir.py`) does **not** call `okunabilir()` itself. Make a TTS-only prepared text copy with the helper, then pass that copy to the synthesizer. - The pronunciation map currently converts `OCR` to `o si ar`, case-insensitively as a whole token. Preserve `OCR` in visible captions; apply the phonetic form only to the speech copy. - When adding a term, use a bounded lexical mapping, decide case handling deliberately, and add tests for the exact output plus case and word-boundary behavior. ## Regression test From `/`, run: ```bash python3 -m unittest test_okunabilir -v ``` The test checks uppercase/lowercase/mixed-case `OCR` conversion and confirms that longer tokens such as `OCR2` and `XOCR` are not changed. ## Synthesis command and result checks Use the installed virtual environment and the prepared text copy: ```bash /ema-venv/bin/python \ /seslendir.py \ --out --speed 1.0 ``` - Default speed is 1.0; use a faster per-format speed (e.g. 1.2) only when that format or request calls for it. Do not change a global default to handle one voice task. - The script's default maximum input is 6000 characters. Check `METIN_KIRPILDI=HAYIR`; shorten or split the script if it would be truncated. - The script prints `OUT`, `BYTES`, `SESLI_SURE_SN`, `GERCEK_ZAMAN_KATI`, and `METIN_KIRPILDI`. Verify the reported `OUT` file exists and has nonzero size. - OGG/Opus is produced when the configured FFmpeg conversion succeeds; otherwise the script may leave a WAV. Deliver the actual output and matching extension, not the requested extension by assumption. - This is a local/offline backend. Do not send the script or audio to an external service as a fallback.