## 3 fixes
### 1. TTS logs not working in dashboard
The stream route (/api/services/[role]/stream) had its own VALID_ROLES
list that was missing 'tts'. Added 'tts' to the list.
### 2. Dashboard doesn't show voices
/api/tts/voices only queried the TTS API (http://tts:8000/v1/audio/voices).
If TTS was not running or the API didn't return custom voices, the list
was empty.
Rewrote /api/tts/voices to use 3 sources:
1. TTS API (if running)
2. voice_to_speaker.yaml (parse voice names from config file)
3. Scan gpu/tts/voices/ directory for .onnx and .wav files
- .onnx files: ru_RU-irina-medium.onnx → 'irina'
- .wav files: myvoice.wav → 'myvoice'
4. Always include defaults (alloy, echo, fable, onyx, nova, shimmer)
### 3. Voices not loading on page open
refreshVoices() was only called when ttsRunning was true. Changed to
always fetch on mount — the API now works even when TTS is stopped
because it reads from config files and directory.
## Version → 0.9.2
## After merge
```sh
git pull && sh build.sh
docker compose up -d --force-recreate dashboard
```
TTS tab should now show irina, denis, dmitri, ruslan in the voice
dropdown (even if TTS is stopped). TTS logs should work in Logs tab.
## What
New TTS tab in the dashboard for text-to-speech generation.
### Backend
- `GET /api/tts/voices` — proxies openedai-speech /v1/audio/voices
- `POST /api/tts/generate` — proxies /v1/audio/speech, streams audio back
- `POST /api/tts/upload-voice` — uploads custom voice sample (WAV/MP3/FLAC)
to gpu/tts/voices/ for XTTSv2 voice cloning
- `GET /api/tts/upload-voice` — lists voice files on disk
### Frontend — TTSTab component
- **Start/Stop/Restart TTS** buttons (uses /api/services/tts)
- **Model select**: tts-1 (Piper, faster) / tts-1-hd (XTTSv2, better quality)
- **Voice select**: lists available voices from /api/tts/voices
- **Format select**: MP3 / WAV / Opus / FLAC
- **Speed slider**: 0.25x — 4.0x
- **Text input**: multi-line, char count, Ctrl+Enter to generate
- **Audio output**: inline audio player + download link
- **Custom voice upload**: drag a WAV sample → saved to gpu/tts/voices/
→ restart TTS to apply. XTTSv2 supports Russian.
### Recommended Russian voices
For natural Russian female voices with XTTSv2:
1. Find a clean 10-20s WAV sample of a female Russian speaker
(mono, 22050 Hz, no background noise)
2. Upload via the 'Upload voice sample' button
3. Restart TTS
4. Select the new voice from the dropdown
5. Generate with Russian text
Good sources for voice samples:
- Record yourself or a friend
- Use a clip from a Russian audiobook (lib.ru)
- Use a clip from a Russian podcast
The built-in 'nova' and 'shimmer' voices (female-sounding) also work
with Russian text on tts-1-hd, though they're English-trained.
## Version → 0.8.0
## After merge
```sh
git pull && sh build.sh
docker compose up -d --force-recreate dashboard
docker compose --profile tts up -d tts
```
Open TTS tab → Start TTS → type Russian text → Generate.