Setting Up PocketSphinx in Mac OS X
Asked Answered
S

1

1

I am running Enthought Python 2.7 as well as default Python 2.7, Xcode 4.5.1 in Mac OS 10.8.2. I am trying to develop a speech to text converter in Python. I use Enthought Python as it allows me to record in 16000Hz, 1 Channel using pyaudio, which is needed for pocketsphinx to work.

I am trying to setup pocketsphinx using brew install pocketsphinx.

I get the following errors enter image description here

Even manual installation using make and using default python results in same errors enter image description here

Using brew doctor, I getenter image description here

How do I successfully install pocketsphinx?

Here is my config.log

Homebrew logs pocketsphinx, sphinxbase

Bash_Profile

Slake answered 8/11, 2012 at 5:37 Comment(2)
The build process fails to find sndfile library. It might becaused by the issues in configure stage. In order to understand such issues you need to check the file config.log created by configure. You need to share that file to enable others to hlep with this problem.Centralization
@NikolayShmyrev: THanks for your reply. I uploaded my config.logSlake
C
1

According to the log you have outdated version of the libsndfile installed. You have a header sndfile.h, but not sndfile.pc pkg-config file:

configure:14532: checking for SNDFILE
configure:14540: $PKG_CONFIG --exists --print-errors "sndfile"
Package sndfile was not found in the pkg-config search path.
Perhaps you should add the directory containing `sndfile.pc'
to the PKG_CONFIG_PATH environment variable
No package 'sndfile' found
configure:14543: $? = 1
configure:14558: $PKG_CONFIG --exists --print-errors "sndfile"
Package sndfile was not found in the pkg-config search path.
Perhaps you should add the directory containing `sndfile.pc'
to the PKG_CONFIG_PATH environment variable
No package 'sndfile' found
configure:14561: $? = 1
No package 'sndfile' found
configure:14589: result: no
configure:14603: checking sndfile.h usability
configure:14603: gcc -std=gnu99 -c -g -O2 -Wall  -
I/Library/Frameworks/Python.framework/Versions/7.3/include/python2.7 -
I/Library/Frameworks/Python.framework/Versions/7.3/include/python2.7 conftest.c >&5
configure:14603: $? = 0
configure:14603: result: yes

To solve this problem either remove the header to not confuse the configure or install newer sndfile with pkg-config support.

Actually that should be fixed in sphinxbase as well, a bug report would be welcome.

Centralization answered 9/11, 2012 at 18:53 Comment(10)
Thanks a lot for your help. I was finally able to install pocketsphinx using brew install pocketsphinxSlake
Here i get a new error, dl.dropbox.com/u/69889915/…Slake
Try to import sphixnbase first and make sure sphinxbase is also installed properly.Centralization
I installed sphinxbase and pocketsphinx properly. BUt the error in the previous link was due to previous manual installation of pocketsphinx which failed while building sphinxbase. But now after successful brew install pocketsphinx, there was no where pocketsphinx libraries in the site-packages in any of the python versions I have. Now it shows ImportError: No module named pocketsphinxSlake
It doesn't seem like the installation is correct. You need to provide more information. Please provide build logs for sphinxbase and pocketsphinx, maybe it didn't build python at all.Centralization
According to the log the file is installed here copying build/lib.macosx-10.8-intel-2.7/sphinxbase.so -> /usr/local/Cellar/cmu-sphinxbase/0.7/lib/python2.7/site-packagesCentralization
I added this to my .bash_profile export LD_LIBRARY_PATH=/usr/local/lib, export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig. But still I dont see any changeSlake
What sort of change to you expect? I'm not sure what your current problem is. Python module lookup is controlled by the PYTHON_PATH environment variable.Centralization
I explained you already that it's not related to the path or to .bash_profile. Instead you need to copy the module (sphinxbase.so and pocketsphinx.so) to the proper location where pocketsphinx will find it.Centralization
What do i do for A/D library not implemented FATAL_ERROR: "continuous.c", line 246: Failed to open audio device logout?Slake

© 2022 - 2024 — McMap. All rights reserved.