Hi,
I have install the latest pocket sphinx 5 pre-alpha from the repository and have got it working using pocketsphinx_continuous.
However, when I try using it from python, I get the following error
~~~~~~~~~~~~~~
Traceback (most recent call last):
File "./pocket2.py", line 47, in <module>
recognised = decodeSpeech(hmdir,lmd,dictd,wavfile)
File "./pocket2.py", line 21, in decodeSpeech
speechRec = ps.Decoder(hmm = hmmd, lm = lmdir, dict = dictp)
TypeError: init() got an unexpected keyword argument 'hmm'
below is the typical sample code I have found from the net
import sys,os
def decodeSpeech(hmmd,lmdir,dictp,wavfile):
try:importpocketsphinxaspsimportsphinxbaseexcept:print"""Pocket sphinx and sphixbase is not installed in your system. Please install it with package manager. """speechRec=ps.Decoder(hmm=hmmd,lm=lmdir,dict=dictp)wavFile=file(wavfile,'rb')wavFile.seek(44)speechRec.decode_raw(wavFile)result=speechRec.get_hyp()returnresult[0]
Hi,
I have install the latest pocket sphinx 5 pre-alpha from the repository and have got it working using pocketsphinx_continuous.
However, when I try using it from python, I get the following error
~~~~~~~~~~~~~~
Traceback (most recent call last):
File "./pocket2.py", line 47, in <module>
recognised = decodeSpeech(hmdir,lmd,dictd,wavfile)
File "./pocket2.py", line 21, in decodeSpeech
speechRec = ps.Decoder(hmm = hmmd, lm = lmdir, dict = dictp)
TypeError: init() got an unexpected keyword argument 'hmm'
import sys,os
def decodeSpeech(hmmd,lmdir,dictp,wavfile):
if name == "main":
~~~~~~~~~~~~~
Any help appriciated.
KND RGS
Mo.
Last edit: Nickolay V. Shmyrev 2015-04-30
Code samples you are using are not relevant, you can find working samples in pocketsphinx sources:
https://github.com/cmusphinx/pocketsphinx/tree/master/swig/python/test
for example:
https://github.com/cmusphinx/pocketsphinx/blob/master/swig/python/test/decoder_test.py
Last edit: Nickolay V. Shmyrev 2015-04-30