Commit 9435615

benny-dou <60535774+benny-dou@users.noreply.github.com>
2025-08-15 16:06:01
fix(asr): convert `.oga` for `groq`
1 parent bb01837
Changed files (1)
src
src/asr/groq.py
@@ -26,7 +26,7 @@ async def groq_asr(path: str | Path, model: str = "", prompt: str = "", temperat
     path = Path(path).expanduser().resolve()
     if not path.is_file():
         return {"texts": "", "error": "File not found."}
-    supported_ext = [".aac", ".flac", ".m4a", ".mp3", ".mpeg", ".mpga", ".oga", ".ogg", ".opus", ".wav", ".webm"]
+    supported_ext = [".aac", ".flac", ".m4a", ".mp3", ".mpeg", ".mpga", ".ogg", ".opus", ".wav", ".webm"]
     audio_path = path if path.suffix.lower() in supported_ext else await downsampe_audio(path, ext="opus", codec="libopus")
     audio_path = await convert_single_channel(audio_path)
     # max allowed file size is 25MB
@@ -267,7 +267,7 @@ async def groq_file_chunks(
     path = Path(path).expanduser().resolve()
     if not path.is_file():
         return {"texts": "", "error": "File not found."}
-    if path.suffix.lower() not in [".opus", ".ogg", ".oga"]:
+    if path.suffix.lower() not in [".opus", ".ogg"]:
         path = await downsampe_audio(path, ext="opus", codec="libopus")
     audio, duration, sr = load_audio(path)
     if sr == 0: