2014-08-31 2 views
0

나는 우분투 14.04LTS에서 pocketsphinx 및 파이썬 & sphenixbase는 최신 자식 소스에서 컴파일 2.7 pocketsphinx을 실행하는 데 노력하고있어. 내가 오류 다음 받고 있어요 코드를 실행하기 위해 노력하고있어 경우 :pocketsphinx : get_hyp

Traceback (most recent call last): 
    File "test.py", line 28, in <module> 
    hyp, uttid, score = speechRec.get_hyp() 
    File "/usr/local/lib/python2.7/dist-packages/pocketsphinx/pocketsphinx.py", line 252, in <lambda> 
    __getattr__ = lambda self, name: _swig_getattr(self, Decoder, name) 
    File "/usr/local/lib/python2.7/dist-packages/pocketsphinx/pocketsphinx.py", line 75, in _swig_getattr 
    raise AttributeError(name) 
AttributeError: get_hyp 

코드 나 실행하려고 해요 :

#!/usr/bin/ python 

import sys 
import pocketsphinx 

if __name__ == "__main__": 

    hmdir = "./lang/model/en_us" 
    lmdir = "./lang/etc/cmusphinx-5.0-en-us.lm.dmp" 
    dictd = "./lang/etc/cmu07a.dic" 
    wavfile = sys.argv[1] 

    config = pocketsphinx.Decoder.default_config() 
    config.set_string('-hmm', hmdir) 
    config.set_string('-lm', lmdir) 
    config.set_string('-dict', dictd) 

    speechRec = pocketsphinx.Decoder(config) 
    audioFile = file(wavfile, 'rb') 
    speechRec.decode_raw(audioFile) 
    hyp, uttid, score = speechRec.get_hyp() 

    print 'Got result'+ hyp+'score'+score 
+0

'get_' 접두사가없는 것은 단지'hyp'입니다. –

답변

1

그것은 hyp하지 get_hyp입니다. pocketsphinx 배포판의 swig/python/test 디렉토리에 몇 가지 코드 샘플을 찾을 수 있습니다.

관련 문제