Traceback (most recent call last):
File "testFolderAction.py", line 47, in <module>
recognisedSpeech = decodeSpeech(hmdir,lmd,dictd,fn)
File "testFolderAction.py", line 33, in decodeSpeech
speechRec.decode_raw(audioFile)
File "/usr/local/lib/python2.7/site-packages/pocketsphinx/pocketsphinx.py", line 318, in <lambda> getattr = lambda self, name: _swig_getattr(self, Decoder, name)
File "/usr/local/lib/python2.7/site-packages/pocketsphinx/pocketsphinx.py", line 88, in _swig_getattr
return _swig_getattr_nondynamic(self, class_type, name, 0)
File "/usr/local/lib/python2.7/site-packages/pocketsphinx/pocketsphinx.py", line 83, in _swig_getattr_nondynamic
return object.getattr(self, name)
AttributeError: type object 'object' has no attribute 'getattr'</lambda></module>
Checking pocketsphinx decoder swig interface in trunk, it doesn't contain wrapping for full file decoding, i.e. "speechRec.decode_raw(audioFile)". Did you add that yourself? Does pocketsphinx/swig/python/test/decoder_test.py works for you?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
decode_raw was removed from API because it is incompatible with Python3. You can decode chunk by chunk, pocketsphinx/swig/python/test/decoder_test.py demonstrates how to do that.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I am getting the following error -
Traceback (most recent call last):
File "testFolderAction.py", line 47, in <module>
recognisedSpeech = decodeSpeech(hmdir,lmd,dictd,fn)
File "testFolderAction.py", line 33, in decodeSpeech
speechRec.decode_raw(audioFile)
File "/usr/local/lib/python2.7/site-packages/pocketsphinx/pocketsphinx.py", line 318, in <lambda>
getattr = lambda self, name: _swig_getattr(self, Decoder, name)
File "/usr/local/lib/python2.7/site-packages/pocketsphinx/pocketsphinx.py", line 88, in _swig_getattr
return _swig_getattr_nondynamic(self, class_type, name, 0)
File "/usr/local/lib/python2.7/site-packages/pocketsphinx/pocketsphinx.py", line 83, in _swig_getattr_nondynamic
return object.getattr(self, name)
AttributeError: type object 'object' has no attribute 'getattr'</lambda></module>
Following is the code I am trying -
psConfig = ps.Decoder.default_config()
psConfig.set_string('-hmm', hmmd)
psConfig.set_string('-lm', lmdir)
psConfig.set_string('-dict', dictp)
speechRec = ps.Decoder(psConfig)
audioFile = file(wavfile,'rb')
audioFile.seek(44)
speechRec.decode_raw(audioFile)
result = speechRec.hyp()
if result is None:
transcribed = ''
else:
transcribed = result.hypstr
return (transcribed)
I am working on RHEL6 (64 bit)
Thanks for the help.
Hi, Sunny.
Checking pocketsphinx decoder swig interface in trunk, it doesn't contain wrapping for full file decoding, i.e. "speechRec.decode_raw(audioFile)". Did you add that yourself? Does pocketsphinx/swig/python/test/decoder_test.py works for you?
decode_raw was removed from API because it is incompatible with Python3. You can decode chunk by chunk, pocketsphinx/swig/python/test/decoder_test.py demonstrates how to do that.