PocketSphinx Documentation
Welcome to the documentation for the Python interface to the PocketSphinx speech recognizer!
Quick Start
To install PocketSphinx on most recent versions of Python, you should
be able to simply use pip
:
pip install pocketsphinx
This is a (somewhat) “batteries-included” install, which comes with a default model and dictionary. Sadly, this model is specifically for US (and, by extension Canadian) English, so it may not work well for your dialect and certainly won’t work for your native language.
On Unix-like platforms you may need to install PortAudio for live audio input to work. Now you can try the simplest possible speech recognizer:
from pocketsphinx import LiveSpeech
for phrase in LiveSpeech():
print(phrase)
This will open the default audio device and start listening, detecting segments of speech and printing out the recognized text, which may or may not resemble what you actually said.
There are of course many other things you can do with it. See the API Documentation for more information.
API Documentation
- Main pocketsphinx package
- Decoder class
Decoder
Decoder.activate_search()
Decoder.add_allphone_file()
Decoder.add_fsg()
Decoder.add_jsgf_file()
Decoder.add_jsgf_string()
Decoder.add_keyphrase()
Decoder.add_kws()
Decoder.add_lm()
Decoder.add_lm_file()
Decoder.add_word()
Decoder.config
Decoder.create_fsg()
Decoder.current_search()
Decoder.default_config()
Decoder.end_utt()
Decoder.file_config()
Decoder.get_alignment()
Decoder.get_cmn()
Decoder.get_config()
Decoder.get_fsg()
Decoder.get_in_speech()
Decoder.get_kws()
Decoder.get_lattice()
Decoder.get_lm()
Decoder.get_logmath()
Decoder.get_prob()
Decoder.get_search()
Decoder.hyp()
Decoder.load_dict()
Decoder.logmath
Decoder.lookup_word()
Decoder.n_frames()
Decoder.nbest()
Decoder.parse_jsgf()
Decoder.process_cep()
Decoder.process_raw()
Decoder.read_fsg()
Decoder.read_jsgf()
Decoder.reinit()
Decoder.reinit_feat()
Decoder.remove_search()
Decoder.save_dict()
Decoder.seg()
Decoder.set_align_text()
Decoder.set_alignment()
Decoder.set_allphone_file()
Decoder.set_cmn()
Decoder.set_fsg()
Decoder.set_jsgf_file()
Decoder.set_jsgf_string()
Decoder.set_keyphrase()
Decoder.set_kws()
Decoder.set_lm()
Decoder.set_lm_file()
Decoder.set_search()
Decoder.start_stream()
Decoder.start_utt()
Decoder.unset_search()
- Simple Recognition classes
- Segmentation and Endpointing classes
- Other classes
Config
Config.default_search_args()
Config.describe()
Config.dumps()
Config.exists()
Config.get_boolean()
Config.get_float()
Config.get_int()
Config.get_string()
Config.items()
Config.parse_file()
Config.parse_json()
Config.set_boolean()
Config.set_float()
Config.set_int()
Config.set_string()
Config.set_string_extra()
Arg
LogMath
Jsgf
JsgfRule
NGramModel
FsgModel
FsgModel.accept()
FsgModel.add_alt()
FsgModel.add_silence()
FsgModel.jsgf_read_file()
FsgModel.null_trans_add()
FsgModel.readfile()
FsgModel.set_final_state()
FsgModel.set_start_state()
FsgModel.tag_trans_add()
FsgModel.trans_add()
FsgModel.word_add()
FsgModel.word_id()
FsgModel.word_str()
FsgModel.writefile()
FsgModel.writefile_fsm()
FsgModel.writefile_symtab()
Lattice
Segment
Hypothesis
Alignment
AlignmentEntry
- Decoder class
- Configuration parameters