Views
No views yet
~/ve_pocketsphinx with the virtual environment you wish to create),
from the top level directory:python3 -m venv ~/ve_pocketsphinx
. ~/ve_pocketsphinx/bin/activate
pip install .-DCMAKE_INSTALL_PREFIX to set a different
prefix in the first cmake command below):cmake -S . -B build
cmake --build build
cmake --build build --target installpocketsphinx command-line program reads single-channel 16-bit
PCM audio from standard input or one or more files, and attemps to
recognize speech in it using the default acoustic and language model.
It accepts a large number of options which you probably don't care
about, a command which defaults to live, and one or more inputs
(except in align mode), or - to read from standard input.pocketsphinx single speech.wavsox as described below.help: Print a long list of those options you don't care about.config: Dump configuration as JSON to standard output (can be
loaded with the -config option).live: Detect speech segments in each input, run recognition
on them (using those options you don't care about), and write the
results to standard output in line-delimited JSON. I realize this
isn't the prettiest format, but it sure beats XML. Each line
contains a JSON object with these fields, which have short names
to make the lines more readable:b: Start time in seconds, from the beginning of the streamd: Duration in secondsp: Estimated probability of the recognition result, i.e. a
number between 0 and 1 representing the likelihood of the input
according to the modelt: Full text of recognition resultw: List of segments (usually words), each of which in turn
contains the b, d, p, and t fields, for start, end,
probability, and the text of the word. If -phone_align yes
has been passed, then a w field will be present containing
phone segmentations, in the same format.single: Recognize each input as a single utterance, and write a
JSON object in the same format described above.align: Align a single input file (or - for standard input) to
a word sequence, and write a JSON object in the same format
described above. The first positional argument is the input, and
all subsequent ones are concatenated to make the text, to avoid
surprises if you forget to quote it. You are responsible for
normalizing the text to remove punctuation, uppercase, centipedes,
etc. For example:pocketsphinx align goforward.wav "go forward ten meters"-phone_align yes in the flags, e.g.:pocketsphinx -phone_align yes align audio.wav $textpocketsphinx align audio.wav $text | jq '.w[]|[.t,.b]'pocketsphinx -phone_align yes align audio.wav $text | jq '.w[]|.w[]|[.t,.d]'soxflags: Return arguments to sox which will create the
appropriate input format. Note that because the sox
command-line is slightly quirky these must always come after the
filename or -d (which tells sox to read from the microphone).
You can run live recognition like this:sox -d $(pocketsphinx soxflags) | pocketsphinx -sox audio.mp3 $(pocketsphinx soxflags) | pocketsphinx --loglevel INFO. Partial results are
not printed, maybe they will be in the future, but don't hold your
breath.Sphinx-II which in turn was
based on some older systems at Carnegie Mellon University, which were
released as free software under a BSD-like license thanks to the
efforts of Kevin Lenzo. Much of the decoder in particular was written
by Ravishankar Mosur (look for "rkm" in the comments), but various
other people contributed as well, see the AUTHORS file
for more details.PocketSphinx which added
various speed and memory optimizations, fixed-point computation, JSGF
support, portability to various platforms, and a somewhat coherent
API. He then disappeared for a while.