feat(stt-client): voix Kokoro (TTS enfichable) + commande --install-kokoro (#55)

Ajoute un moteur TTS plus naturel (Kokoro, ONNX/CPU) au choix, Piper restant
le défaut et le repli.

- engine.py : synthèse enfichable (_synthesize → _synth_piper | _synth_kokoro).
  Kokoro chargé une fois (préchargé au boot si sélectionné), WAV via wave stdlib
  (numpy → PCM16), lecture/interruption inchangées. Repli SILENCIEUX si le modèle
  ou le paquet kokoro-onnx manque (jamais de crash).
- config : [voice].tts_engine ("piper"|"kokoro") + kokoro_voice (ff_siwis, FR),
  kokoro_speed, kokoro_lang.
- cli : `stt --install-kokoro` télécharge kokoro-v1.0.onnx + voices-v1.0.bin dans
  ~/.local/share/kokoro et imprime les étapes (pipx inject kokoro-onnx, espeak-ng).
- pyproject : extra optionnel [kokoro] ; client 0.15.0.
- doc : stt.example.toml + admin/ia/stt.md + journal.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
ALI YESILKAYA 2026-06-22 23:57:27 +02:00 committed by GitHub
parent 666abe765b
commit 610d32f1e9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 161 additions and 19 deletions

View file

@ -247,7 +247,15 @@ Machine à états du moteur vocal (`stt/client/stt/voice/engine.py`) :
Côté client, pilotable depuis `stt/client/config/` + l'écran de réglages du HUD :
- **Avatar / image** (`config/avatars/`), **thème** (`config/themes/`),
**voix** Piper `.onnx` (`config/voices/`), **wake word**, **URL serveur**.
**voix**, **wake word**, **URL serveur**.
**Moteur TTS — `[voice].tts_engine`** : `piper` (défaut, rapide, voix `.onnx` dans
`~/.local/share/piper/`) **ou** `kokoro` (nettement plus naturel, ONNX/CPU). Pour Kokoro :
`stt --install-kokoro` (télécharge `kokoro-v1.0.onnx` + `voices-v1.0.bin` dans
`~/.local/share/kokoro/`), `pipx inject stt kokoro-onnx`, `espeak-ng` (phonémisation FR), puis
`tts_engine = "kokoro"` (voix FR `kokoro_voice = "ff_siwis"`). Le client **précharge** Kokoro au
démarrage et **retombe en silence** proprement si le modèle/paquet manque (`engine._synth_kokoro`).
La synthèse est enfichable (`engine._synthesize`) — Piper reste le repli.
---