summaryrefslogtreecommitdiff
path: root/boot/boot.py
diff options
context:
space:
mode:
Diffstat (limited to 'boot/boot.py')
-rwxr-xr-xboot/boot.py20
1 files changed, 11 insertions, 9 deletions
diff --git a/boot/boot.py b/boot/boot.py
index 59217ec..fcaeedd 100755
--- a/boot/boot.py
+++ b/boot/boot.py
@@ -1,14 +1,16 @@
#!/usr/bin/env python
-import os, json
+import os, sys
import urllib2
import yaml
-
import vocabcompiler
+import traceback
+
+lib_path = os.path.abspath('../client')
+sys.path.append(lib_path)
-def say(phrase, OPTIONS = " -vdefault+m3 -p 40 -s 160 --stdout > ../static/audio/say.wav"):
- os.system("espeak " + json.dumps(phrase) + OPTIONS)
- os.system("aplay -D hw:1,0 ../static/audio/say.wav")
+import speaker as speak
+speaker = speak.newSpeaker()
def configure():
try:
@@ -19,17 +21,17 @@ def configure():
vocabcompiler.compile("../client/sentences.txt", "../client/dictionary.dic", "../client/languagemodel.lm")
print "STARTING CLIENT PROGRAM"
- os.system("/home/pi/jasper/client/start.sh &")
+ os.system("$JASPER_HOME/jasper/client/start.sh &")
except:
-
print "COULD NOT CONNECT TO NETWORK"
- say("Hello, I could not connect to a network. Please read the documentation to configure your Raspberry Pi.")
+ traceback.print_exc()
+ speaker.say("Hello, I could not connect to a network. Please read the documentation to configure your Raspberry Pi.")
if __name__ == "__main__":
print "==========STARTING JASPER CLIENT=========="
print "=========================================="
print "COPYRIGHT 2013 SHUBHRO SAHA, CHARLIE MARSH"
print "=========================================="
- say("Hello.... I am Jasper... Please wait one moment.")
+ speaker.say("Hello.... I am Jasper... Please wait one moment.")
configure()