python - Pocketsphinx new_Decoder runtime error -
i'm facing error in pocketsphinx code. have both pocketsphinx , sphinxbase installed. , have built both of these packages visual studio. here code:
#!/usr/bin/python os import environ, path pocketsphinx.pocketsphinx import * sphinxbase.sphinxbase import * modeldir = "../../../model" datadir = "../../../test/data" config = decoder.default_config() config.set_string('-hmm', path.join(modeldir, 'en-us/en-us')) config.set_string('-lm', path.join(modeldir, 'en-us/en-us.lm.bin')) config.set_string('-dict', path.join(modeldir, 'en-us/cmudict-en-us.dict')) config.set_string('-logfn', '/dev/null') decoder = decoder(config) stream = open(path.join(datadir, 'goforward.raw'), 'rb') #stream = open('10001-90210-01803.wav', 'rb') in_speech_bf = false decoder.start_utt() while true: buf = stream.read(1024) if buf: decoder.process_raw(buf, false, false) if decoder.get_in_speech() != in_speech_bf: in_speech_bf = decoder.get_in_speech() if not in_speech_bf: decoder.end_utt() print ('result:', decoder.hyp().hypstr) decoder.start_utt() else: break decoder.end_utt()
and here error:
this = _pocketsphinx.new_decoder(*args) runtimeerror: new_decoder returned -1
Comments
Post a Comment