Qt wrapper around pocketsphinx with basic functionality focused on keywords. Currently only tested and working on Unix systems. Windows is planned for the future
This requires CMUSphinx to be compiled/installed on your system. This takes inspiration from the abandoned QtSpeech project to include Speech-To-Text functionality (currently it only has Text-To-Speech functionality).
While you can just compile and install CMUSphinx without any modications, I highly recommend applying the pocketsphinx_qt.patch located in the main directory. It adds the functionality to use keywords from memory rather than requiring a file to read from.
You can follow the installation from the CMUSphinx Tutorial to install PocketSphinx on your system. Or follow the instructions in the next section.
- clone https://github.com/cmusphinx/sphinxbase
- go into the
sphinxbase
folder and run./autogen.sh
./configure
thenmake
andmake install
- clone https://github.com/cmusphinx/pocketsphinx
- copy the
pocketsphinx_qt.patch
located in theQtSpeechRecognition
folder, into thepocketsphinx
folder - go into the
pocketsphinx
folder and runpatch -p1 < pocketsphinx_qt.patch
to patch the files. - run
./autogen.sh
./configure
thenmake
andmake install
CMUSphinx installs the libraries by default in the /usr/local/lib/
directory. Most systems do not load libraries from this directory. You can either move them to the normal library location, or do something like:
- Editing
/etc/ld.so.conf
to contain/usr/local/lib
directory, and thensudo ldconfig
to update the config - Or by exporting:
export LD_LIBRARY_PATH=/usr/local/lib
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
See the CMUSphinx Tutorial if you have more questions regarding setting up the libraries.
The pocketsphinx
folder contains a model
folder, containing the models needed for speech recognition.
Drop them in the same directory as the DLLTestLoader
application (I should've renamed it to Demo
Instead). It should load the model just fine.
If the model doesn't load, check the path to laod the model when initializing the speech recognition library.
Simple solution for including CMUSphinx files for compile is to look in the QtSpeechRecognition
folder. There's two empty folders here with the names pocketsphinx
and sphinxbase
. Drop your respective pocketsphinx
and sphinxbase
cloned repos in the same place and the default links will work just fine