Hiding a window is now only for Windows systems

This commit is contained in:
Menonro 2024-03-20 17:41:05 +06:00 committed by GitHub
parent 4fda47955b
commit 2566f688ee
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -55,7 +55,10 @@ def load_audio(file: str, sr: int = SAMPLE_RATE):
] ]
# fmt: on # fmt: on
try: 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: except CalledProcessError as e:
raise RuntimeError(f"Failed to load audio: {e.stderr.decode()}") from e raise RuntimeError(f"Failed to load audio: {e.stderr.decode()}") from e