Skip to content

Commit

Permalink
fix speech to text endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
ebubae committed Nov 30, 2024
1 parent e9578b0 commit 41ab55c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/controllers/speechToText.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 41ab55c

Please sign in to comment.