From f5af8263545a5f10760ac581e519d3b4a1a79f06 Mon Sep 17 00:00:00 2001 From: Sharyu Marwadi Date: Sat, 5 Oct 2024 10:09:16 +0530 Subject: [PATCH] error fixed and .ogg extension added --- service/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/service/main.py b/service/main.py index cf5afb4..2d46c4b 100644 --- a/service/main.py +++ b/service/main.py @@ -30,9 +30,9 @@ async def upload_audio(body: Body): try: print("----------audio file link-----------",body.audio_file_link,"-----------------------") # Check file type - if not body.audio_file_link.endswith(('.m4a', '.mp4','.mp3','.webm','.mpga','.wav','.mpeg')): + if not body.audio_file_link.endswith(('.m4a', '.mp4','.mp3','.webm','.mpga','.wav','.mpeg','.ogg')): logger.error("invalid file type") - raise HTTPException(status_code=400, detail="Invalid file type") + return JSONResponse(status_code=400, content={"message":"Invalid file type"}) print("---------------------translation started-----------------------") #translation = translate_with_whisper(transcription) translation = translate_with_whisper(body.audio_file_link)