Installing PocketSphinx on Debian Jessie

Here are my notes on the instructions I used to install PocketSphinx on Debian Jessie.

Install the Debian packages

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.

Download and compile the PocketSphinx source code

git clone

cd ~/sphinxbase

make clean all
make check
sudo make install
git clone

cd ~/pocketsphinx

make clean all
make check
sudo make install

Running the PocketSpinx Ruby gem

Before you can execute the pocketsphinx-ruby gem it is necessary to set the library paths e.g. :


Note: Remember to modify the above lines to match the directory where you stored sphinxbase and pocketsphinx.

type irb

Copy and paste the following code into the IRB sesssion:

require 'pocketsphinx-ruby' do |speech|
  puts speech


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.


16-01-2016 23:55