{"id":24249,"library":"pocketsphinx","title":"PocketSphinx","description":"Official Python bindings for PocketSphinx, a lightweight speech recognition engine. Current version 5.0.4. Release cadence is irregular; updates coincide with upstream changes.","status":"active","version":"5.0.4","language":"python","source_language":"en","source_url":"https://github.com/cmusphinx/pocketsphinx","tags":["speech-recognition","audio","cmusphinx","asr"],"install":[{"cmd":"pip install pocketsphinx","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"The correct import is just 'import pocketsphinx'. No module alias changed.","wrong":"","symbol":"pocketsphinx","correct":"import pocketsphinx"},{"note":"LiveSpeech is a convenience wrapper; Decoder is the core class for manual control.","wrong":"from pocketsphinx import LiveSpeech","symbol":"Decoder","correct":"from pocketsphinx import Decoder"}],"quickstart":{"code":"import pocketsphinx\n\ndecoder = pocketsphinx.Decoder()\ndecoder.start_utt('test')\ndecoder.process_raw(b'Some audio data', False, False)\ndecoder.end_utt()\nprint(decoder.hypothesis())","lang":"python","description":"Minimal example using Decoder to process raw audio bytes."},"warnings":[{"fix":"Replace 'from pocketsphinx.pocketsphinx import Decoder' with 'from pocketsphinx import Decoder'.","message":"In v5, the module is imported as 'import pocketsphinx' (no 'pocketsphinx.pocketsphinx'). Older examples use 'from pocketsphinx.pocketsphinx import Decoder' which no longer works.","severity":"breaking","affected_versions":">=5.0.0"},{"fix":"Use Decoder with appropriate configuration instead of LiveSpeech.","message":"The 'LiveSpeech' class is deprecated in favor of using Decoder directly. It may be removed in future versions.","severity":"deprecated","affected_versions":">=5.0.0"},{"fix":"Resample and convert audio before passing to Decoder. Use libraries like pydub or scipy for conversion.","message":"pocketsphinx requires audio in 16-bit mono PCM format at 16000 Hz. Providing audio in other formats will silently fail or produce garbage results.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use `from pocketsphinx import Decoder` or `import pocketsphinx; decoder = pocketsphinx.Decoder()`.","cause":"Incorrect import path. The module is not a package with submodules; `import pocketsphinx` gives the module directly.","error":"AttributeError: module 'pocketsphinx' has no attribute 'Decoder'"},{"fix":"Use `from pocketsphinx import Decoder`.","cause":"Old API path. v5 removed the nested package.","error":"pocketsphinx.pocketsphinx.Decoder not found"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}