Skip to content

Speakr is a personal, self-hosted web application designed for transcribing audio recordings

Python

unsupported files in the connectors

Murtaza Nasir33c90394b30a
diff --git a/src/services/transcription/connectors/openai_transcribe.py b/src/services/transcription/connectors/openai_transcribe.py
index 9feb65d2..18367f36 100644
--- a/src/services/transcription/connectors/openai_transcribe.py
+++ b/src/services/transcription/connectors/openai_transcribe.py
@@ -39,12 +39,15 @@ class OpenAITranscribeConnector(BaseTranscriptionConnector):
# - 25MB file size limit
# - 1400 second max duration for diarize model
# - chunking_strategy="auto" handles files >30s internally
+ # Supported formats: mp3, mp4, mpeg, mpga, m4a, wav, webm, flac, ogg, oga
+ # NOT supported: opus (used by WhatsApp voice notes, Discord)
SPECIFICATIONS = ConnectorSpecifications(
max_file_size_bytes=25 * 1024 * 1024, # 25MB
max_duration_seconds=1400, # ~23.3 minutes max for diarize model
min_duration_for_chunking=30, # >30s needs chunking_strategy param
handles_chunking_internally=True, # Uses chunking_strategy="auto"
requires_chunking_param=True, # Must send chunking_strategy for >30s
+ unsupported_codecs=frozenset({'opus'}), # OpenAI API doesn't support opus
)
# Models and their capabilities
diff --git a/src/services/transcription/connectors/openai_whisper.py b/src/services/transcription/connectors/openai_whisper.py
index 870f1c9d..60807cf3 100644
--- a/src/services/transcription/connectors/openai_whisper.py
+++ b/src/services/transcription/connectors/openai_whisper.py
@@ -34,10 +34,13 @@ class OpenAIWhisperConnector(BaseTranscriptionConnector):
PROVIDER_NAME = "openai_whisper"
# OpenAI Whisper has a 25MB file limit and doesn't handle chunking internally
+ # Supported formats: mp3, mp4, mpeg, mpga, m4a, wav, webm, flac, ogg, oga
+ # NOT supported: opus (used by WhatsApp voice notes, Discord)
SPECIFICATIONS = ConnectorSpecifications(
max_file_size_bytes=25 * 1024 * 1024, # 25MB
handles_chunking_internally=False,
recommended_chunk_seconds=600, # 10 minutes
+ unsupported_codecs=frozenset({'opus'}), # OpenAI API doesn't support opus
)
def __init__(self, config: Dict[str, Any]):