sprec - speech recognition command
sprec [OPTIONS] < audio
sprec reads audio from stdin and prints speech recognition results.
--alts=NUM
Specify the max number of alternative results.
-h, --help
Print help and exit.
--partial
Also print intermediate results.
--phrase-file=FILE
Limit the vocab to phrases in a file. The phrases are split at whitespace unless quoted "like this". If the special phrase [unk] is included, it will be given for unrecognized words instead of the best match.
--version
Print the version and exit.
The speech recognition model can be specified with the SPREC_MODEL environment variable. The default is /usr/share/vosk-models/small-en-us. sprec should work well with possibly all of the *-small and *-lgraph models from https://alphacephei.com/vosk/models.
The correct audio format depends on the model, but possibly all the Vosk models like WAVE 16000Hz Mono, which you can record with:
arecord -q -fS16_LE -c1 -r16000
Print realtime speech recognition results:
arecord -q -fS16_LE -c1 -r16000 -D sysdefault:CARD=Microphone | spec
See the sprec_type script for an example that types out the results (https://git.sr.ht/~geb/sprec/examples/sprec_type).
John Gebbie