whisper.cpp icon indicating copy to clipboard operation
whisper.cpp copied to clipboard

Accept pipe to stream

Open tamo opened this issue 1 month ago • 0 comments

Now it is easy to test with raw PCM data. Try cat pcmf32.raw | stream (or pv -qL 64000 pcmf32.raw | stream in realtime)

Note: I haven't tested WIN32 ifdefs.

You can make such data by ffmpeg -i jfk.wav -f f32le -acodec pcm_f32le -ar 16000 -ac 1 jfk.raw

I use a kind of remote transcription service like:

mic2some | ssh -C remote "exec ffmpeg -loglevel fatal -i pipe:0 -f f32le -ar 16000 -acodec pcm_f32le -ac 1 pipe:1 |stream"

So if you want to do a test, run stream --test-pipe --no-vt100 2>/dev/null < pcmf32.raw to get nearly-reproducible results. If you want to do a more strict testing, use --no-timestamps as well.

cat jfk.raw | ./build/bin/stream -m models/ggml-large-v2.bin --step 2000 --test-pipe -no-vt100 2>/dev/null
( And so my fellow Americans...)
( And so my fellow Americans, ask...)
( And so my fellow Americans, ask not what your country will give you, but what your country will give you.)
[00:00:00.000 --> 00:00:30.000]   And so my fellow Americans, ask not what your country can do for you.

( Ask what you can do for your)
[00:00:02.360 --> 00:00:32.360]   Ask what you can do for your country.

VAD:

cat jfk.raw | ./build/bin/stream -m models/ggml-large-v2.bin --step -2000 --test-pipe -no-vt100 2>/dev/null

[00:00:00.000 --> 00:00:03.000]   And so, my fellow Americans.

[00:00:00.000 --> 00:00:07.920]   Ask not what your country can do for you, ask what you can do for your country.

tamo avatar Jan 02 '25 05:01 tamo