From 41ab55cd3140e91034aa3e4aeb1341b79bca4bb7 Mon Sep 17 00:00:00 2001 From: Ebube Chuba Date: Sat, 30 Nov 2024 10:25:43 -0500 Subject: [PATCH] fix speech to text endpoint --- src/controllers/speechToText.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/controllers/speechToText.ts b/src/controllers/speechToText.ts index 42aa33bf..8bc66593 100644 --- a/src/controllers/speechToText.ts +++ b/src/controllers/speechToText.ts @@ -30,7 +30,7 @@ export const getTranscription: MiddleWare = async (req, res, next) => { throw new Error('Audio URL must either be hosted publicly or a valid base64.'); } - let payload = { id: '', url: '' }; + let payload = { audioUrl: '' }; const base64 = audio.startsWith('https://') ? await fetchBase64Data(audio) : audio; // If the audio doesn't come from Igbo API S3, we will pass into IgboSpeech @@ -50,10 +50,9 @@ export const getTranscription: MiddleWare = async (req, res, next) => { return { data: { audioId: '', audioUrl: '' } }; }); - payload = { id: response.audioId, url: response.audioUrl }; + payload = { audioUrl: response.audioUrl }; } else { - const audioId = parseAWSIdFromUri(audio); - payload = { id: audioId, url: audio }; + payload = { audioUrl: audio }; } // Talks to prediction endpoint