Skip to content

Commit

Permalink
error fixed and .ogg extension added
Browse files Browse the repository at this point in the history
  • Loading branch information
SharyuMarwadi committed Oct 5, 2024
1 parent acd9db8 commit f5af826
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions service/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit f5af826

Please sign in to comment.