Tuesday, August 2, 2016

Setting Up an Offline Transcriber Using Kaldi - Part 3: Sphinx, not Kaldi

How to install PocketSphinx 5Prealpha on Mint 17.3.

We're going to install work with these packages in a folder located at ~/tools.  Make sure this exists.
mkdir ~/tools
Download pocketsphinx and sphinxbase from the downloads page:
Move the files from your downloads to your project folder and extract them.
tar -xzf ~/Downloads/sphinxbase-5prealpha.tar.gz -C ~/tools/
tar -xzf ~/Downloads/pocketsphinx-5prealpha.tar.gz -C ~/tools/
Make sure dependencies are installed.  You're installing libpulse-dev so that sphinxbase will configure itself to work with PulseAudio, the recommended audio framework on Ubuntu (and, by extension, on Mint).
sudo apt-get install python-dev pulseaudio libpulse-dev gcc automake autoconf libtool bison swig
Note: make sure that swig is at least version 2.0.  You can check with this command:
dpkg -p swig | grep Version
Move into the sphinxbase folder.
cd ~/tools/sphinxbase-5prealpha
Since you downloaded the release version, the configure file has already been generated.  It's time to configure, make and make install!
./configure
make
sudo make install
Sphinxbase is installed in /usr/local/lib; in case Mint 17 doesn't look there for program libraries, you have to manually tell it to use that location.  Here's the commands:
export LD_LIBRARY_PATH=/usr/local/lib
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
Now move into the pocketsphinx folder and do the same installation:
cd ~/tools/pocketsphinx-5prealpha
./configure
make
sudo make install
you can test the installation by running the following; it should be recognizing what you speak into the microphone.
pocketsphinx_continuous -inmic yes
If you want to transcribe a file, use this command:
pocketsphinx_continuous -infile file.wav
If you run into trouble, this should help.








Final post here

I'm switching over to github pages .  The continuation of this blog (with archives included) is at umhau.github.io .  By the way, the ...