From 2566f688eed1c60e40ec6bfbd863a225c73963db Mon Sep 17 00:00:00 2001 From: Menonro Date: Wed, 20 Mar 2024 17:41:05 +0600 Subject: [PATCH] Hiding a window is now only for Windows systems --- whisper/audio.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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