diff --git a/whisper/__init__.py b/whisper/__init__.py index e210718f3..091565741 100644 --- a/whisper/__init__.py +++ b/whisper/__init__.py @@ -50,6 +50,8 @@ "turbo": b"ABzY8j^C+e0{>%RARaKHP%t(lGR*)0g!tONPyhe`", } +ffmpeg_path: str = "ffmpeg" + def _download(url: str, root: str, in_memory: bool) -> Union[bytes, str]: os.makedirs(root, exist_ok=True) diff --git a/whisper/audio.py b/whisper/audio.py index 826250f37..426306769 100644 --- a/whisper/audio.py +++ b/whisper/audio.py @@ -7,6 +7,7 @@ import torch import torch.nn.functional as F +import whisper from .utils import exact_div # hard-coded audio hyperparameters @@ -43,7 +44,7 @@ def load_audio(file: str, sr: int = SAMPLE_RATE): # and resampling as necessary. Requires the ffmpeg CLI in PATH. # fmt: off cmd = [ - "ffmpeg", + whisper.ffmpeg_path, "-nostdin", "-threads", "0", "-i", file,