diff --git a/pitch-deck/app/api/presenter/tts/route.ts b/pitch-deck/app/api/presenter/tts/route.ts index 93cfdf6..4e1b6cf 100644 --- a/pitch-deck/app/api/presenter/tts/route.ts +++ b/pitch-deck/app/api/presenter/tts/route.ts @@ -6,13 +6,16 @@ const LITELLM_API_KEY = process.env.LITELLM_API_KEY || '' // OVH AI Endpoints TTS via the LiteLLM passthrough. // Path on the LiteLLM side: /tts-ovh/audio/* → https://nvr-tts-.endpoints.kepler.ai.cloud.ovh.net/api/* +// OVH DE is opt-in: set OVH_TTS_ENABLED_DE=true to activate. +// When disabled, German falls through to the compliance TTS service (Edge TTS → Piper). const OVH_TTS = { - de: { - url: process.env.OVH_TTS_URL_DE || `${LITELLM_URL}/tts-ovh/audio/v1/tts/text_to_audio`, - // German only exposes a male voice; note the hyphen separator (EN uses dots). - voice: process.env.OVH_TTS_VOICE_DE || 'German-DE-Male-1', - languageCode: 'de-DE', - }, + de: process.env.OVH_TTS_ENABLED_DE === 'true' + ? { + url: process.env.OVH_TTS_URL_DE || `${LITELLM_URL}/tts-ovh/audio/v1/tts/text_to_audio`, + voice: process.env.OVH_TTS_VOICE_DE || 'German-DE-Male-1', + languageCode: 'de-DE', + } + : null, // Enable by setting OVH_TTS_URL_EN (e.g. pointing at a second LiteLLM // passthrough that targets nvr-tts-en-us). Keeps EN on the old path until set. en: process.env.OVH_TTS_URL_EN @@ -22,7 +25,7 @@ const OVH_TTS = { languageCode: 'en-US', } : null, -} as const +} const SAMPLE_RATE_HZ = parseInt(process.env.OVH_TTS_SAMPLE_RATE || '16000', 10)