refac: audio recording

This commit is contained in:
Timothy Jaeryang Baek
2025-05-04 18:17:35 +04:00
parent 2946f5fcce
commit 62366ad020
3 changed files with 46 additions and 32 deletions

View File

@@ -125,12 +125,16 @@ def upload_file(
)
if process:
try:
if file.content_type in [
"audio/mpeg",
"audio/wav",
"audio/ogg",
"audio/x-m4a",
]:
if file.content_type.startswith(
(
"audio/mpeg",
"audio/wav",
"audio/ogg",
"audio/x-m4a",
"audio/webm",
)
):
file_path = Storage.get_file(file_path)
result = transcribe(request, file_path)