whisper.cpp only supports wav-files. I have files in other formats I want to transcribe. It would be nice if I could make the conversion and transcription in one step/using a one-liner.
I have tried these two, and some variant, but they failed:
whisper.cpp -m ~/usr/whisper.cpp/models/ggml-large.bin < ffmpeg -i sample.amr -f wav
ffmpeg -i sample.amr -f wav pipe:1 | whisper.cpp -m ~/usr/whisper.cpp/models/ggml-large.bin
From the whisper.cpp help page:
usage: whisper.cpp [options] file0.wav file1.wav ...
-f FNAME, --file FNAME [ ] input WAV file path
(The help page doesn't mention stdin
, pipes
etc)
You can use -f -
to read from stdin.
For example:
ffmpeg -nostdin -threads 0 -i $INPUT_AUDIO_FILE -f wav -ac 1 -acodec pcm_s16le -ar 16000 - | whisper.cpp -m models/ggml-tiny.en.bin -f -