From deafef05f33179b8dd865893eb4705b513f906dc Mon Sep 17 00:00:00 2001 From: sawadata <92194484+sawadata@users.noreply.github.com> Date: Fri, 30 Sep 2022 04:34:04 +0900 Subject: [PATCH] Update audio.py (#178) add '-nostdin' argument --- whisper/audio.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/whisper/audio.py b/whisper/audio.py index cb4eed2..a6074e8 100644 --- a/whisper/audio.py +++ b/whisper/audio.py @@ -41,7 +41,7 @@ def load_audio(file: str, sr: int = SAMPLE_RATE): out, _ = ( ffmpeg.input(file, threads=0) .output("-", format="s16le", acodec="pcm_s16le", ac=1, ar=sr) - .run(cmd="ffmpeg", capture_stdout=True, capture_stderr=True) + .run(cmd=["ffmpeg", "-nostdin"], capture_stdout=True, capture_stderr=True) ) except ffmpeg.Error as e: raise RuntimeError(f"Failed to load audio: {e.stderr.decode()}") from e