mirror of
https://github.com/openai/whisper.git
synced 2025-11-23 22:15:58 +00:00
Fix exception cause in audio.py (#33)
This commit is contained in:
parent
c85eaaae29
commit
59f543e218
@ -44,7 +44,7 @@ def load_audio(file: str, sr: int = SAMPLE_RATE):
|
|||||||
.run(cmd="ffmpeg", capture_stdout=True, capture_stderr=True)
|
.run(cmd="ffmpeg", capture_stdout=True, capture_stderr=True)
|
||||||
)
|
)
|
||||||
except ffmpeg.Error as e:
|
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
|
return np.frombuffer(out, np.int16).flatten().astype(np.float32) / 32768.0
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user