From 09ac22f692a88243c7922ed5a329449ecff50045 Mon Sep 17 00:00:00 2001 From: Sharang Parnerkar <30073382+mighty840@users.noreply.github.com> Date: Thu, 16 Apr 2026 21:37:52 +0200 Subject: [PATCH] fix(pitch-deck): revert OVH synthesis rate to 16000 Hz MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit OVH honours sample_rate_hz and returns data at exactly the requested rate, so synthesis and WAV header rates must always match. Decoupled 22050/16000 caused 22050 Hz PCM wrapped in a 16000 Hz header → slow bloated playback. Both back to 16000 Hz. Co-Authored-By: Claude Sonnet 4.6 --- pitch-deck/app/api/presenter/tts/route.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pitch-deck/app/api/presenter/tts/route.ts b/pitch-deck/app/api/presenter/tts/route.ts index 61349cd..93cfdf6 100644 --- a/pitch-deck/app/api/presenter/tts/route.ts +++ b/pitch-deck/app/api/presenter/tts/route.ts @@ -24,9 +24,6 @@ const OVH_TTS = { : null, } as const -// Rate sent to OVH in the synthesis request (affects internal model quality). -const OVH_SYNTHESIS_RATE_HZ = parseInt(process.env.OVH_TTS_SYNTHESIS_RATE || '22050', 10) -// Actual rate of the raw PCM bytes OVH returns (used for the WAV header). const SAMPLE_RATE_HZ = parseInt(process.env.OVH_TTS_SAMPLE_RATE || '16000', 10) export async function POST(request: NextRequest) { @@ -64,7 +61,7 @@ async function synthesizeViaOvh( body: JSON.stringify({ encoding: 1, // LINEAR_PCM language_code: cfg.languageCode, - sample_rate_hz: OVH_SYNTHESIS_RATE_HZ, + sample_rate_hz: SAMPLE_RATE_HZ, text, voice_name: cfg.voice, }),