Aller au contenu

Services TTS et STT sur srv759970

Point d'entrée unique pour les services de synthèse vocale (TTS) et transcription audio (STT) hébergés ou consommés par le VPS.


Vue d'ensemble

┌─────────────────────────────────────────────────────────────────┐
│  SERVICES LOCAUX (self-hosted, gratuits)                         │
│                                                                  │
│  TTS  edge-tts ──────── port 8765 (systemd tts-service)         │
│  STT  faster-whisper ── port 9000 (Docker stt-server)           │
└─────────────────────────────────────────────────────────────────┘

┌─────────────────────────────────────────────────────────────────┐
│  PROVIDERS CLOUD (payants, clés API)                             │
│                                                                  │
│  TTS  Cartesia ──── sk_car_*** ── Domo (streaming) + Reading     │
│  TTS  OpenAI TTS ── OPENAI_API_KEY ── Domo (actif, gpt-4o-mini) │
│  STT  Cartesia ──── sk_car_*** ── Domo (actif)                   │
│  STT  OpenAI STT ── OPENAI_API_KEY ── Domo (enhanced_logic)     │
└─────────────────────────────────────────────────────────────────┘

┌─────────────────────────────────────────────────────────────────┐
│  PROVIDERS DISPONIBLES DANS LE CODE (non actifs en prod)         │
│                                                                  │
│  TTS  ElevenLabs ─── Domo (code présent, clé non configurée)    │
│  TTS  SparkTTS ───── Domo (modèle local, désactivé cloud mode)  │
│  TTS  Kokoro ──────── Domo (externe port 8880, non démarré)      │
└─────────────────────────────────────────────────────────────────┘

Consommateurs par service

Application TTS utilisé STT utilisé
audioguides edge-tts (local 8765)
domo OpenAI gpt-4o-mini-tts Cartesia (actif)
reading-coach legacy Cartesia sonic-3
reading-coach-next Cartesia (optionnel)
pi-daemon (voice Telegram) faster-whisper ⚠️ non installé
client Windows (AHK) stt-server :9000

1. tts-service — Edge TTS (local, gratuit)

Rôle

Serveur HTTP minimal qui expose edge-tts (Microsoft Neural TTS en ligne de commande) comme API REST. Génère des fichiers MP3 directement sur le disque du VPS. Utilisé principalement par l'application audioguides qui a besoin de synthèse vocale sur des fichiers locaux.

Accès

Paramètre Valeur
Port interne 127.0.0.1:8765
Endpoint POST /tts
Auth aucune (interne uniquement)
Coût gratuit (Microsoft Azure Neural via CLI)

Endpoint /tts

Body JSON :

{
  "text": "Texte à synthétiser",
  "voice": "fr-FR-VivienneMultilingualNeural",
  "output_path": "/audioguides/guide-001.mp3"
}

Réponse :

{"success": true, "path": "/audioguides/guide-001.mp3", "size": 45312, "voice": "fr-FR-VivienneMultilingualNeural"}

Path mapping : le chemin /audioguides/... est traduit automatiquement en /opt/n8n/audioguides/... sur le host.

Voix disponibles (edge-tts)

edge-tts --list-voices | grep fr-FR
# Principales voix françaises :
# fr-FR-DeniseNeural
# fr-FR-HenriNeural
# fr-FR-VivienneMultilingualNeural  ← défaut configuré

Fichiers clés

/home/automation/tts-service.py       ← script Python (HTTPServer + edge-tts subprocess)
/home/automation/.local/bin/edge-tts  ← CLI edge-tts (pip install edge-tts)

Service systemd

sudo systemctl status tts-service
sudo systemctl restart tts-service
journalctl -u tts-service -n 50

2. stt-server — faster-whisper (local, self-hosted)

Rôle

Container Docker exposant une API FastAPI de transcription audio via faster-whisper (optimisé int8 CPU) + Silero VAD. C'est le service STT de référence pour les clients externes (Windows AHK, apps tierces). Exposé publiquement avec authentification Bearer.

Accès

Paramètre Valeur
URL publique https://stt.srv759970.hstgr.cloud
Port interne 127.0.0.1:9000
Container stt-server
Auth Bearer STT_API_KEY (voir /opt/stt/server/.env)
Modèle actif medium (int8 CPU)
RAM ~1.5 GB
Coût gratuit (self-hosted)

Endpoints

Method Path Auth Description
GET /health Health check
GET /models Modèles disponibles
POST /transcribe ✅ Bearer Transcription fichier audio

POST /transcribe

curl -X POST https://stt.srv759970.hstgr.cloud/transcribe \
  -H "Authorization: Bearer <STT_API_KEY>" \
  -F "file=@audio.wav" \
  -F "language=fr"
  # options: language=auto, initial_prompt, hotwords, word_timestamps=true

Réponse :

{
  "text": "Texte transcrit complet",
  "segments": [{"start": 0.0, "end": 5.6, "text": "..."}],
  "language": "fr",
  "language_probability": 1.0,
  "duration": 8.09,
  "processing_time": 10.44
}

Performance (4 vCPU AMD EPYC 9354P)

Modèle RAM Vitesse (1 min audio) Qualité FR
tiny 75 MB ~2s ⭐⭐
base 142 MB ~4s ⭐⭐⭐
small 466 MB ~8s ⭐⭐⭐⭐
medium 1.5 GB ~15s ⭐⭐⭐⭐⭐ ← actif
large-v3 3.1 GB ~40s ⭐⭐⭐⭐⭐

Configuration

/opt/stt/server/.env
  STT_API_KEY          ← clé Bearer
  STT_WHISPER_MODEL    = medium
  STT_WHISPER_LANGUAGE = fr
  STT_WHISPER_COMPUTE_TYPE = int8
  STT_MAX_UPLOAD_MB    = 100

Commandes Docker

docker compose -f /opt/stt/docker-compose.yml logs -f stt
docker compose -f /opt/stt/docker-compose.yml restart stt
docker compose -f /opt/stt/docker-compose.yml up -d --build

Client Windows

Projet 2026.04 STT on VPS/client/ : - stt_client.py — record micro → API → clipboard - stt_hotkey.ahk — AutoHotkey v2 (Ctrl+Shift+Space → record → paste)


3. Cartesia — TTS + STT cloud

Rôle

Provider cloud multi-usage : TTS streaming (voix naturelles, latence faible) utilisé par reading-coach et Domo, STT (transcription) utilisé activement par Domo. Une seule clé API (sk_car_***) pour les deux usages.

Accès

Paramètre Valeur
Clé API CARTESIA_API_KEY=sk_car_5y25UBtP... dans /opt/domo/.env
TTS modèle sonic-3 (reading-coach legacy)
STT API cloud Cartesia
Coût payant (par seconde audio)

Usages actifs

Service Usage Cartesia Config
Domo STT actif (STT_PROVIDER=cartesia) /opt/domo/.env
Domo TTS disponible (cartesia_tts, cartesia_tts_streaming) — (actif si TTS_PROVIDER=cartesia)
reading-coach legacy TTS sonic-3 pour narration livres api.js (clé hardcodée ⚠️)
reading-coach-next TTS optionnel (NEXT_PUBLIC_TTS_MODE=cartesia) .env.local

Note sécurité — reading-coach legacy ⚠️

La clé Cartesia est hardcodée dans /opt/reading-coach/api.js :

CARTESIA_API_KEY = process.env.CARTESIA_API_KEY || 'sk_car_...'
→ @TODO : externaliser dans un .env ou credstore.


4. OpenAI TTS + STT — Domo

Rôle

Provider cloud OpenAI utilisé par Domo pour la synthèse vocale (actif en production) et comme modèle de transcription alternatif (disponible dans enhanced_logic.py).

Config active (Domo)

# /opt/domo/.env
TTS_PROVIDER=openai
OPENAI_MODEL_TTS=gpt-4o-mini-tts        # synthèse vocale → actif
OPENAI_TRANSCRIPTION_MODEL=gpt-4o-mini-transcribe   # STT → disponible
STT_PROVIDER=cartesia   # STT prod = Cartesia, pas OpenAI
Usage Modèle Statut
TTS (Domo prod) gpt-4o-mini-tts ✅ actif
STT (enhanced_logic) gpt-4o-mini-transcribe ⚠️ disponible, pas le provider actif

Coût

Payant (OPENAI_API_KEY partagée avec les appels LLM OpenAI dans Domo).


5. Providers disponibles dans Domo (non actifs en prod)

Domo est conçu pour switcher de provider via TTS_PROVIDER. Ces providers sont intégrés dans le code mais non configurés en production actuelle :

ElevenLabs

# app/app.py
TTS_PROVIDER = 'elevenlabs'
ELEVENLABS_TTS_VOICE = os.getenv("ELEVENLABS_TTS_VOICE")
ELEVENLABS_TTS_MODEL = os.getenv("ELEVENLABS_TTS_MODEL")
- Clé non définie dans /opt/domo/.env - Statut : non actif — clé à ajouter pour activer

SparkTTS (local GPU)

# app/app.py
# ☁️ Cloud mode: SparkTTS not available, switching to openai TTS
- Nécessite PyTorch + GPU - Le VPS tourne en cloud mode → SparkTTS automatiquement désactivé - Statut : non disponible sur VPS (CPU only)

Kokoro (local, port 8880)

# app/main.py
KOKORO_BASE_URL = os.getenv("KOKORO_BASE_URL", "http://localhost:8880/v1")
- Serveur Kokoro non démarré sur le VPS (port 8880 fermé) - Compatible API OpenAI audio (/v1/audio/voices) - Statut : non démarré — démarrer un container Kokoro pour activer

faster-whisper local (Domo)

  • Présent dans /opt/domo/app/transcription.py
  • WARNING: faster-whisper not installed. Local transcription unavailable.
  • Statut : non installépip install faster-whisper dans l'env Domo pour activer

6. Historique — WhisperX (archivé)

Ancienne stack de transcription basée sur WhisperX (3 containers : whisper + redis queue + worker). Abandonnée car trop lourde en CPU et complexe à maintenir.

Ancien (whisperx) Nouveau (stt-server)
Stack 3 containers 1 container
Modèle small medium
Port 8001 9000
Auth aucune Bearer token
Diarisation oui (pyannote, très lent) non
Status ⛔ arrêté ✅ production

Les sources sont archivées dans apps/02-ai-transcription/whisperx/.

⚠️ Le port 8001 est actuellement occupé par storyteller-web-1 (container non lié au STT).


Résumé rapide

Je veux... J'utilise...
Transcrire de l'audio (API externe) POST https://stt.srv759970.hstgr.cloud/transcribe + Bearer
Générer un MP3 sur le VPS (audioguides) POST http://127.0.0.1:8765/tts (edge-tts, gratuit)
TTS voix naturelle cloud (Domo actuel) OpenAI gpt-4o-mini-tts via /opt/domo/.env
TTS streaming temps-réel Cartesia sonic-3 (reading-coach) ou Cartesia streaming (Domo)
STT temps-réel dans Domo Cartesia (STT_PROVIDER=cartesia dans /opt/domo/.env)
Connaître la clé STT API /opt/stt/server/.envSTT_API_KEY
Connaître la clé Cartesia /opt/domo/.envCARTESIA_API_KEY
Activer ElevenLabs dans Domo Ajouter ELEVENLABS_API_KEY + TTS_PROVIDER=elevenlabs dans /opt/domo/.env

Inventaire complet (état 2026-05-21)

Service Port Type Statut Coût Consommateurs
tts-service (edge-tts) 8765 TTS local ✅ running gratuit audioguides
stt-server (faster-whisper) 9000 STT local ✅ running gratuit client Windows AHK
Cartesia TTS cloud TTS cloud ✅ actif payant reading-coach, Domo (option)
Cartesia STT cloud STT cloud ✅ actif payant Domo (prod)
OpenAI TTS (gpt-4o-mini-tts) cloud TTS cloud ✅ actif payant Domo (prod)
OpenAI STT (gpt-4o-mini-transcribe) cloud STT cloud ⚠️ disponible payant Domo (enhanced_logic)
ElevenLabs TTS cloud TTS cloud ⛔ non configuré payant Domo (code prêt)
SparkTTS (local GPU) TTS local ⛔ cloud mode gratuit Domo (désactivé VPS)
Kokoro TTS 8880 TTS local ⛔ non démarré gratuit Domo (code prêt)
faster-whisper (Domo local) STT local ⛔ non installé gratuit Domo, pi-daemon voice
WhisperX (archivé) STT local ⛔ archivé gratuit