I read a lot of how-to's on how to get pocketsphinx functional on Ubuntu 10.04 but I always got stuck at some point.
These are the two failures I could never get around:
1. Failed to open audio device(/dev/dsp): No such file or directory
:207:218) = -2837676
These are the two failures I could never get around:
1. Failed to open audio device(/dev/dsp): No such file or directory
2. ERROR: "acmod.c", line 88: Must specify -mdef or -hmm
After a lot of trying different things out, here are the steps that allowed me to get a raw file transcribed.
aptitude install python-pocketsphinx
aptitude install pocketsphinx-hmm-wsj1
aptitude install pocketsphinx-lm-wsj
aptitude install pocketsphinx-hmm-wsj1
aptitude install pocketsphinx-lm-wsj
The ps_test.py file will be located in /usr/share/doc/python-pocketsphinx/examples
Change the first line to
decoder = ps.Decoder(hmm="/usr/share/pocketsphinx/model/hmm/wsj1",
lm="/usr/share/pocketsphinx/model/lm/wsj/wlist5o.3e-7.vp.tg.lm.DMP",
dict="/usr/share/pocketsphinx/model/lm/wsj/wlist5o.dic",
fwdtree="yes",
fwdflat="yes",
bestpath="no")
lm="/usr/share/pocketsphinx/model/lm/wsj/wlist5o.3e-7.vp.tg.lm.DMP",
dict="/usr/share/pocketsphinx/model/lm/wsj/wlist5o.dic",
fwdtree="yes",
fwdflat="yes",
bestpath="no")
Change line 2 to:
fh = open("test.raw", "rb")
And generate a test.raw file and put it in /usr/share/doc/python-pocketsphinx/examples
Running python ps_test.py will still generate an error but you should get a first transcription:
Decoded 35136 samples
THE DEMAND JUMPED OVER THE MILAN (000000000 -40091455)
P(FORWARD|GO) = -4.346504, 2
INFO: ngram_search.c(1046): lattice start node .0 end node .207
INFO: ps_lattice.c(1225): Normalizer P(O) = alpha(
INFO: ps_lattice.c(1263): Joint P(O,S) = -2853722 P(S|O) = -16046
P(S|O) = -1.604786e+00
FORWARD is:
Traceback (most recent call last):
File "ps_test.py", line 30, in
print "FORWARD is:", forward.word, forward.sf, forward.fef, forward.lef, forward.prob
NameError: name 'forward' is not defined
My raw file had the phrase 'The man jumped over the moon'
It was transcribed to 'THE DEMAND JUMPED OVER THE MILAN'
Changing hmm to hub4opensrc.cd_continuous_8gau, lm to language_model.arpaformat.DMP and adding the word MOON to the dictionary got me to the following transcription: 'THE MEN JUMPED OVER THE MOON'
Not bad, IMHO
Changing hmm to hub4opensrc.cd_continuous_8gau, lm to language_model.arpaformat.DMP and adding the word MOON to the dictionary got me to the following transcription: 'THE MEN JUMPED OVER THE MOON'
Not bad, IMHO