Manpage logo

sprec - speech recognition command

NAME  SYNOPSIS  DESCRIPTION  OPTIONS  MODEL  AUDIO  EXAMPLES  AUTHOR 

NAME

sprec - speech recognition command

SYNOPSIS

sprec [OPTIONS] < audio

DESCRIPTION

sprec reads audio from stdin and prints speech recognition results.

OPTIONS

--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.

MODEL

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.

AUDIO

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

EXAMPLES

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).

AUTHOR

John Gebbie


Updated 2026-06-01 - jenkler.se | uex.se