Tuesday, June 1, 2010

CMU Sphinx error: ./wave2feat: error while loading shared libraries: libsphinxbase.so.1: cannot open shared object file: No such file or directory

I'm doing some research on voice recognition. Really doing my first steps on this field. I've been struggling to get started using CMU sphinx for the last two days. The tutorial published on the CMU sphinx site has some flaws. For instance, it says you need to build the trainer first, but if you don't build the sphinxbase code first, it wont let you build it, saying it's missing sphinxbase. Then, it doesn't say you need to install sphinxbase either. So after building sphinxbase, make sure to run

# cd sphinxbase
# make install

Now, when you think you have everything in place, and you get to the point where you perform a preliminary training run

# perl scripts_pl/make_feats.pl -ctl etc/an4_train.fileids
The, I started getting this error:

./wave2feat: error while loading shared libraries: libsphinxbase.so.1: cannot open shared object file: No such file or directory

This drove me nuts, until I stumbled into this post, and this gave me the idea to run this command:

# sudo ldconfig -v | grep sphinx

you should get an output like this:
libsphinxbase.so.1 -> libsphinxbase.so.1.1.1
libsphinxad.so.0 -> libsphinxad.so.0.0.1

If there's no output, try editing the /etc/ld.so.conf file and add a /usr/local/lib line at the end of the file. I tried this at first bout found it's not neccesary if you run the ldconfig command it will refresh the references automatically.

No comments: