Reputation: 438
I'm trying to use pocketsphinx on python 3.2 but I'm very confused. I've placed the builded packages in the site-packages directory, made sure I'm using the right audio file format .According to the documentation python is supported because there are python bindings. I've looked around the forum and it seems that an _init_.py
file is needed which is not included so that may be an issue? Any suggestions on how to fix this problem?
I am currently using pocketsphinx and sphinxbase v 0.8 downloaded link and link. The files I put into site packages are all files contained in the Debug folder of the pocketsphinx directory. namely:
I am using the following Python code:
import pocketsphinx as ps
from pocketsphinx import sphinxbase
hmmd = 'C:\Python32\Lib\site-packages\pocketsphinx\model\hmm\en_US\hub4wsj_sc_8k'
lmd = 'C:\Python32\Lib\site-packages\pocketsphinx\model\lm\en_US\hub4.5000.DMP'
dictd = 'C:\Python32\Lib\site-packages\pocketsphinx\model\lm\en_US\hub4.5000.dic'
fraw1 = file(r'C:\Users\Stefan\Documents\2012\40I6\test1.wav', 'rb')
fraw1.seek(44)
speechRec = ps.Decoder(hmm = hmmd, lm = lmd, dict = dictd) speechRec.decode_raw(fRaw1)
result = speechRec.get_hyp()
print (result[0])
Upvotes: 0
Views: 2626
Reputation: 25210
To compile python module do the following:
Run the command
python setup_win32.py install
Change directory to pocketsphinx/python
Run the command
python setup_win32.py install
Run the command to test python
python ps_test.py
Upvotes: 1