Here are my notes on the instructions I used to install PocketSphinx on Debian Jessie.
sudo apt-get install swig sudo apt-get install python-dev sudo apt-get install libpulse-dev
The swig and python-dev packages were required to compile sphinxbase. While libpulse-dev was necessary to successfully execute the Ruby code using the pocketsphinx-ruby gem.
git clone https://github.com/cmusphinx/sphinxbase.git cd ~/sphinxbase ./autogen.sh ./configure make clean all make check sudo make install
git clone https://github.com/cmusphinx/pocketsphinx.git cd ~/pocketsphinx ./autogen.sh ./configure make clean all make check sudo make install
Before you can execute the pocketsphinx-ruby gem it is necessary to set the library paths e.g. :
LD_LIBRARY_PATH=/home/james/sphinxbase/src/libsphinxbase/.libs/:/home/james/sphinxbase/src/libsphinxad/.libs/:/home/james/pocketsphinx/src/libpocketsphinx/.libs/ export LD_LIBRARY_PATH
Note: Remember to modify the above lines to match the directory where you stored sphinxbase and pocketsphinx.
Copy and paste the following code into the IRB sesssion:
require 'pocketsphinx-ruby' Pocketsphinx::LiveSpeechRecognizer.new.recognize do |speech| puts speech end
PocketSphinx is continually under development which combined with the changes to packages in upgraded versions of Debian means it is highly like the above instructions will fail to either compile PocketSphinx as well as to run the PocketSphinx-ruby gem. In that case search online for more recent documentation, or take a note of the error messages and try to fix the problem yourself. If another Debian package is required you may need to recompile sphinxbase as well pocketsphinx. If a recompilation of sphinxbase is necessary it would be necessary to recompile pocketsphinx too.
PocketSphinx makes it possible to demonstrate the potential for speech recognition, however it is dependent upon many factors for it to successfully recognise the correct words including quality of the microphone, microphone volume, background noise, processing capability of the computer, the dictionary of words it recognises as well as the accent of the speaker.