Skip to content

Commit

Permalink
Merge pull request #39 from SH4DOW4RE/main
Browse files Browse the repository at this point in the history
Catching pydub's warning of ffmpeg or avconv missing
  • Loading branch information
gagb authored Dec 16, 2024
2 parents 978c876 + 980abd3 commit e7a2e20
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/markitdown/_markitdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import zipfile
from typing import Any, Dict, List, Optional, Union
from urllib.parse import parse_qs, quote, unquote, urlparse, urlunparse
from warnings import catch_warnings

import mammoth
import markdownify
Expand All @@ -31,7 +32,13 @@

# Optional Transcription support
try:
import pydub
# Using warnings' catch_warnings to catch
# pydub's warning of ffmpeg or avconv missing
with catch_warnings(record=True) as w:
import pydub

if w:
raise ModuleNotFoundError
import speech_recognition as sr

IS_AUDIO_TRANSCRIPTION_CAPABLE = True
Expand Down

0 comments on commit e7a2e20

Please sign in to comment.