I'm trying to use pocketpshinx with Python 3.4 but i'm facing some difficulties.
I successfully built pocketpshinx (and sphinxbase) from subversion (checked out yersteday) on Ubuntu Trusty.
I ran the decode_test.py with python 2.7 and it's worked fine. But I want to tuse Python3, and I got the following error :
Traceback (most recent call last):
File "decode.py", line 8, in <module>
config = Decoder.default_config()
NameError: name 'Decoder' is not defined</module>
The code :
from sphinxbase import *
from pocketsphinx import *
Hi !
I'm trying to use pocketpshinx with Python 3.4 but i'm facing some difficulties.
I successfully built pocketpshinx (and sphinxbase) from subversion (checked out yersteday) on Ubuntu Trusty.
I ran the decode_test.py with python 2.7 and it's worked fine. But I want to tuse Python3, and I got the following error :
Traceback (most recent call last):
File "decode.py", line 8, in <module>
config = Decoder.default_config()
NameError: name 'Decoder' is not defined</module>
The code :
from sphinxbase import *
from pocketsphinx import *
hmdir = "/vagrant/cmusphinx/lium_french_f0"
dictd = "/vagrant/cmusphinx/frenchWords62K.dic"
lm = "/vagrant/cmusphinx/testGrammar.lm"
config = Decoder.default_config()
config.set_string('-hmm', hmdir)
config.set_string('-jsgf', lm)
config.set_string('-dict', dictd)
decoder = Decoder(config)
decoder.decode_raw(open('output.wav', 'rb'))
hypothesis = decoder.hyp()
print('Best hypothesis: ', hypothesis.best_score, hypothesis.hypstr)
print('Best hypothesis segments: ', [seg.word for seg in decoder.seg()])
Is pocketsphinx not compatible with python3 ?
Thanks for helping
Last edit: Leitur 2014-07-07
This issue has been fixed in trunk, pocketsphinx is now compatible with python3.
Thanks for the report and sorry for delay.