PocketSphinx is a Carnegie Mellon speech recognizer aimed at efficient deployment. It provides C and Python APIs plus a command-line decoder for PCM audio.
Overview
PocketSphinx is an open source large-vocabulary, speaker-independent continuous speech recognition engine from Carnegie Mellon University. Its acoustic and language models reflect older research lines but remain useful where small footprint and efficiency matter.
The C library and Python module can be built with CMake on Linux and Windows. A pocketsphinx CLI reads single-channel 16-bit PCM from files or standard input and outputs recognition results as line-delimited JSON. Commands cover live segmentation, single-utterance decoding, forced alignment to supplied text, and configuration export.
Alignment modes can return word, phone, or state timings for downstream processing with tools such as jq. Helper output suggests sox arguments to convert arbitrary audio into the expected format for live microphone or file decoding.
Example programs illustrate library use from C and Python. The project no longer depends on a separate SphinxBase package; build and API documentation are generated from the same tree.
Key features
- Speaker-independent continuous recognition
- C library and Python bindings
- CLI with JSON line output
- Live, single-utterance, and align modes
- Word, phone, and state forced alignment
- sox integration hints for audio conversion
- CMake builds for C library installation
- Configurable logging and JSON config dump
Use cases
- Offline speech decoding on constrained hardware
- Forced alignment for transcription pipelines
- Embedding recognition in C or Python applications
- Batch decoding of PCM or converted audio files