root@raspberrypi:/home/pi/jasper# ./jasper.py --debug
*******************************************************
* JASPER - THE TALKING COMPUTER *
* (c) 2015 Shubhro Saha, Charlie Marsh & Jan Holthuis *
*******************************************************
DEBUG:client.diagnose:Checking network connection to server 'www.google.com'...
DEBUG:client.diagnose:Network connection working
DEBUG:__main__:Trying to read config file: '/root/.jasper/profile.yml'
DEBUG:client.diagnose:Checking python import 'pocketsphinx'...
DEBUG:client.diagnose:Python package 'pocketsphinx' found: '/usr/local/lib/python2.7/dist-packages/pocketsphinx/__init__.py'
DEBUG:client.diagnose:Checking executable 'aplay'...
DEBUG:client.diagnose:Executable 'aplay' found: '/usr/bin/aplay'
DEBUG:client.diagnose:Checking executable 'text2wave'...
DEBUG:client.diagnose:Executable 'text2wave' found: '/usr/bin/text2wave'
DEBUG:client.diagnose:Checking executable 'festival'...
DEBUG:client.diagnose:Executable 'festival' found: '/usr/bin/festival'
DEBUG:client.tts:Executing festival --pipe
DEBUG:client.vocabcompiler:compiled_revision is 'bb74ae36d130ef20de710e3a77b43424b8fa774f'
ERROR:root:Error occured!
Traceback (most recent call last):
File "./jasper.py", line 138, in <module>
app = Jasper()
File "./jasper.py", line 101, in __init__
stt_engine_class.get_passive_instance(),
File "/home/pi/jasper/client/stt.py", line 48, in get_passive_instance
return cls.get_instance('keyword', phrases)
File "/home/pi/jasper/client/stt.py", line 42, in get_instance
instance = cls(**config)
File "/home/pi/jasper/client/stt.py", line 126, in __init__
**vocabulary.decoder_kwargs)
TypeError: __init__() got an unexpected keyword argument 'hmm'
self._decoder = ps.Decoder(hmm=hmm_dir, logfn=self._logfile, **vocabulary.decoder_kwargs)
#self._decoder = ps.Decoder(logfn=self._logfile, hmm=hmm_dir, **vocabulary.decoder_kwargs)
psConfig = ps.Decoder.default_config()
psConfig.set_string('-hmm', hmm_dir)
psConfig.set_string('-lm', '/home/pi/lmfiles/cmusphinx-5.0-en-us.lm.dmp')
psConfig.set_string('-dict', '/home/pi/dictfiles/cmudict-0.7b.dict')
self._decoder = ps.Decoder(psConfig)
self._decoder = ps.Decoder(logfn=self._logfile, hmm=hmm_dir, **vocabulary.decoder_kwargs) psConfig = ps.Decoder.default_config()
psConfig.set_string('-hmm', hmm_dir)
psConfig.set_string('-lm', vocabulary.decoder_kwargs['lm'])
psConfig.set_string('-dict', vocabulary.decoder_kwargs['dict'])
self._decoder = ps.Decoder(psConfig) result = self._decoder.get_hyp()result = self._decoder.hyp()transcribed = [result[0]]transcribed = (result.hypstr, '') if result is None:
transcribed = ''
else:
transcribed = result.hypstrWhich seems to work wonderfully well. It seemed that in somecases result would end up as a NoneType which would cause things to error out. What this does is check to see if result has anything in it, and pass on either an empty string, or the object 'hypstr'
DONT DO THIS
First, you need to install Pocketsphinx. If you’re using Debian Sid (unstable) or Jessie (testing), you can just do:
sudo apt-get update
sudo apt-get install pocketsphinx
FOLLOW THIS
If you’re not using Debian Sid/Jessie, you need to compile and install them from source:
wget http://downloads.sourceforge.net/project/cmusphinx/sphinxbase/0.8/sphinxbase-0.8.tar.gz
tar -zxvf sphinxbase-0.8.tar.gz
cd ~/sphinxbase-0.8/
./configure --enable-fixed
make
sudo make install
wget http://downloads.sourceforge.net/project/cmusphinx/pocketsphinx/0.8/pocketsphinx-0.8.tar.gz
tar -zxvf pocketsphinx-0.8.tar.gz
cd ~/pocketsphinx-0.8/
./configure
make
sudo make installTo use the Pocketsphinx STT engine, you also need to install MIT Language Modeling Toolkit, m2m-aligner and Phonetisaurus (and thus OpenFST).
DONT DO THIS
On Debian, you can install these from the experimental repository:
sudo su -c "echo 'deb http://ftp.debian.org/debian experimental main contrib non-free' > /etc/apt/sources.list.d/experimental.list"
sudo apt-get update
sudo apt-get -t experimental install phonetisaurus m2m-aligner mitlm
FOLLOW BELOW STEPS
If you’re not using Debian, perform these steps:
wget http://distfiles.macports.org/openfst/openfst-1.3.3.tar.gz
wget https://mitlm.googlecode.com/files/mitlm-0.4.1.tar.gz
wget https://m2m-aligner.googlecode.com/files/m2m-aligner-1.2.tar.gz
wget https://phonetisaurus.googlecode.com/files/phonetisaurus-0.7.8.tgz
Build and Install all of the above Manually. See the further steps at
http://jasperproject.github.io/documentation/installation/
To resize swap space:
sudo nano /etc/dphys-swapfile
CONF_SWAPSIZE=250
sudo dphys-swapfile setup
sudo dphys-swapfile swapon
ls -l /var/swap
sudo apt-get --purge clean
Free the Swap space
sudo swapoff -a
sudo update-rc.d -f dphys-swapfile remove
sudo rm /var/swap
ls -l /var/swap
free -h