depot/third_party/nixpkgs/pkgs/development/python-modules/openai-whisper/ffmpeg-path.patch
Default email d2947cfef0 Project import generated by Copybara.
GitOrigin-RevId: 598f83ebeb2235435189cf84d844b8b73e858e0f
2022-10-06 20:32:54 +02:00

13 lines
643 B
Diff

diff --git a/whisper/audio.py b/whisper/audio.py
index a6074e8..da18350 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", "-nostdin"], capture_stdout=True, capture_stderr=True)
+ .run(cmd=["@ffmpeg@/bin/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