From 1f5c11b999c8cfb46a6172e93937da8b84191ed6 Mon Sep 17 00:00:00 2001 From: "suraj.shenoy.b@gmail.com" Date: Sat, 25 Jan 2025 21:09:55 -0600 Subject: [PATCH] Update route.js --- src/app/api/transcribe/route.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/app/api/transcribe/route.js b/src/app/api/transcribe/route.js index 0f45155..1196d66 100644 --- a/src/app/api/transcribe/route.js +++ b/src/app/api/transcribe/route.js @@ -81,10 +81,9 @@ export async function POST(req, res) { // Step 2: Get transcription from OpenAI Whisper model console.log('Requesting transcription...'); - const transcription = await openaiClient.audio.transcriptions.create({ - file: audio_file, - model: 'whisper-1', - response_format: 'text', + const transcription = await openai.audio.translations.create({ + file: fs.createReadStream(audio_file), + model: "whisper-1", }); // Clean up temporary file