From 6a6b3e8cee5610c910f9faa18821c9ec5775ca61 Mon Sep 17 00:00:00 2001 From: Sharang Parnerkar <30073382+mighty840@users.noreply.github.com> Date: Thu, 16 Apr 2026 21:40:32 +0200 Subject: [PATCH] feat(pitch-deck): make OVH DE TTS opt-in via OVH_TTS_ENABLED_DE env var MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Without the flag, German routes to the compliance TTS service which uses Edge TTS (de-DE-ConradNeural) with Piper as fallback — easier to A/B between OVH and compliance/Edge TTS without code changes. Co-Authored-By: Claude Sonnet 4.6 --- pitch-deck/app/api/presenter/tts/route.ts | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) 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)