From 59f543e2188ca5846d3595479f78ce1c2be2bfa2 Mon Sep 17 00:00:00 2001 From: Ram Rachum Date: Fri, 23 Sep 2022 06:12:37 +0300 Subject: [PATCH] Fix exception cause in audio.py (#33) --- whisper/audio.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/whisper/audio.py b/whisper/audio.py index aced188515d..cb4eed26920 100644 --- a/whisper/audio.py +++ b/whisper/audio.py @@ -44,7 +44,7 @@ def load_audio(file: str, sr: int = SAMPLE_RATE): .run(cmd="ffmpeg", capture_stdout=True, capture_stderr=True) ) except ffmpeg.Error as e: - raise RuntimeError(f"Failed to load audio: {e.stderr.decode()}") + raise RuntimeError(f"Failed to load audio: {e.stderr.decode()}") from e return np.frombuffer(out, np.int16).flatten().astype(np.float32) / 32768.0