Originally created by @gjgd on GitHub (Sep 21, 2024).
Is your feature request related to a problem? Please describe.
When I upload a .m4a file for transcription, I get the following error
Describe the solution you'd like
I would like .m4a type to be supported, currently I have to convert the file to .mp3 before I can upload it
Originally created by @gjgd on GitHub (Sep 21, 2024).
**Is your feature request related to a problem? Please describe.**
When I upload a .m4a file for transcription, I get the following error
<img width="328" alt="CleanShot 2024-09-21 at 15 35 16@2x" src="https://github.com/user-attachments/assets/eff470fb-6386-4f84-940a-c795582a28fc">
<img width="403" alt="CleanShot 2024-09-21 at 15 34 31@2x" src="https://github.com/user-attachments/assets/40b1f111-0d43-4efe-adb7-508ba3a4974c">
**Describe the solution you'd like**
I would like .m4a type to be supported, currently I have to convert the file to .mp3 before I can upload it
@gjgd commented on GitHub (Sep 22, 2024):
Sure! Here are a couple, github doesn't allow sharing audio files directly but I pushed them to a git repo: https://github.com/gjgd/audio-samples
def is_m4a_audio(file_path):
"""Check if the given file is an M4A audio file."""
if not os.path.isfile(file_path):
print(f"File not found: {file_path}")
return False
info = mediainfo(file_path)
if (
info.get("codec_name") == "aac"
and info.get("codec_type") == "audio"
and info.get("codec_tag_string") == "audio/x-m4a"
):
return True
return False
def convert_m4a_to_wav(file_path, output_path):
"""Convert M4A audio file to WAV format."""
audio = AudioSegment.from_file(file_path, format="m4a")
audio.export(output_path, format="wav")
print(f"Converted {file_path} to {output_path}")
Line 433
++
if is_m4a_audio(file_path):
print("is_m4a_audio")
os.rename(file_path, file_path.replace(".wav", ".m4a"))
# Convert MP4 audio file to WAV format
convert_m4a_to_wav(file_path.replace(".wav", ".m4a"), file_path)
@rgaricano commented on GitHub (Sep 23, 2024):
¿maybe? (i did`t test)
open-webui/backend/open_webui/apps/audio/main.py
Line 127
++
```
def is_m4a_audio(file_path):
"""Check if the given file is an M4A audio file."""
if not os.path.isfile(file_path):
print(f"File not found: {file_path}")
return False
info = mediainfo(file_path)
if (
info.get("codec_name") == "aac"
and info.get("codec_type") == "audio"
and info.get("codec_tag_string") == "audio/x-m4a"
):
return True
return False
def convert_m4a_to_wav(file_path, output_path):
"""Convert M4A audio file to WAV format."""
audio = AudioSegment.from_file(file_path, format="m4a")
audio.export(output_path, format="wav")
print(f"Converted {file_path} to {output_path}")
```
Line 433
++
```
if is_m4a_audio(file_path):
print("is_m4a_audio")
os.rename(file_path, file_path.replace(".wav", ".m4a"))
# Convert MP4 audio file to WAV format
convert_m4a_to_wav(file_path.replace(".wav", ".m4a"), file_path)
```
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @gjgd on GitHub (Sep 21, 2024).
Is your feature request related to a problem? Please describe.


When I upload a .m4a file for transcription, I get the following error
Describe the solution you'd like
I would like .m4a type to be supported, currently I have to convert the file to .mp3 before I can upload it
@tjbck commented on GitHub (Sep 22, 2024):
Could you provide us with some sample files?
@gjgd commented on GitHub (Sep 22, 2024):
Sure! Here are a couple, github doesn't allow sharing audio files directly but I pushed them to a git repo: https://github.com/gjgd/audio-samples
@rgaricano commented on GitHub (Sep 23, 2024):
¿maybe? (i did`t test)
open-webui/backend/open_webui/apps/audio/main.py
Line 127
++
Line 433
++
@tjbck commented on GitHub (Sep 24, 2024):
Added to dev.