From b12a493fe5248d51ad755586e8a306d820ce9770 Mon Sep 17 00:00:00 2001 From: Romain Dauby Date: Thu, 29 May 2025 16:57:23 -0400 Subject: [PATCH] fix: only trust codec_name for audio conversion Some files have .wav extension with incompatible OpenAI codec --- backend/open_webui/routers/audio.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/backend/open_webui/routers/audio.py b/backend/open_webui/routers/audio.py index d337ece2e..eeb490259 100644 --- a/backend/open_webui/routers/audio.py +++ b/backend/open_webui/routers/audio.py @@ -96,12 +96,9 @@ def is_audio_conversion_required(file_path): # File is AAC/mp4a audio, recommend mp3 conversion return True - # If the codec name or file extension is in the supported formats - if ( - codec_name in SUPPORTED_FORMATS - or os.path.splitext(file_path)[1][1:].lower() in SUPPORTED_FORMATS - ): - return False # Already supported + # If the codec name is in the supported formats + if (codec_name in SUPPORTED_FORMATS): + return False return True except Exception as e: