diff --git a/whisper/audio.py b/whisper/audio.py index 0a5032e..72e1a1f 100644 --- a/whisper/audio.py +++ b/whisper/audio.py @@ -55,7 +55,10 @@ def load_audio(file: str, sr: int = SAMPLE_RATE): ] # fmt: on try: - out = run(cmd, capture_output=True, check=True, creationflags=CREATE_NO_WINDOW).stdout + creationflags = None + if os.name == 'nt': + creationflags = CREATE_NO_WINDOW + out = run(cmd, capture_output=True, check=True, creationflags=creationflags).stdout except CalledProcessError as e: raise RuntimeError(f"Failed to load audio: {e.stderr.decode()}") from e