From c1a49a4b925abfd10f4a6faa85d8afe9689bdd4c Mon Sep 17 00:00:00 2001 From: schneefux Date: Tue, 27 May 2014 23:25:31 -0700 Subject: moved static assets to separate folder --- boot/boot.py | 8 ++++---- boot/say.wav | Bin 151944 -> 0 bytes client/JOKES.txt | 47 ----------------------------------------------- client/beep_hi.wav | Bin 37656 -> 0 bytes client/beep_lo.wav | Bin 37100 -> 0 bytes client/mic.py | 6 +++--- client/modules/Joke.py | 2 +- static/audio/beep_hi.wav | Bin 0 -> 37656 bytes static/audio/beep_lo.wav | Bin 0 -> 37100 bytes static/audio/say.wav | Bin 0 -> 151944 bytes static/text/JOKES.txt | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 11 files changed, 55 insertions(+), 55 deletions(-) delete mode 100644 boot/say.wav delete mode 100644 client/JOKES.txt delete mode 100644 client/beep_hi.wav delete mode 100644 client/beep_lo.wav create mode 100644 static/audio/beep_hi.wav create mode 100644 static/audio/beep_lo.wav create mode 100644 static/audio/say.wav create mode 100644 static/text/JOKES.txt diff --git a/boot/boot.py b/boot/boot.py index ebe6b35..b042004 100755 --- a/boot/boot.py +++ b/boot/boot.py @@ -6,9 +6,9 @@ import yaml import vocabcompiler -def say(phrase, OPTIONS = " -vdefault+m3 -p 40 -s 160 --stdout > say.wav"): +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 say.wav") + os.system("aplay -D hw:1,0 ../static/audio/say.wav") def configure(): try: @@ -20,9 +20,9 @@ def configure(): print "STARTING CLIENT PROGRAM" os.system("/home/pi/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.") os.system("sudo shutdown -r now") diff --git a/boot/say.wav b/boot/say.wav deleted file mode 100644 index d27c7dc..0000000 Binary files a/boot/say.wav and /dev/null differ diff --git a/client/JOKES.txt b/client/JOKES.txt deleted file mode 100644 index adfb0e3..0000000 --- a/client/JOKES.txt +++ /dev/null @@ -1,47 +0,0 @@ -little old lady -wow... I didn't know you could yodel... get it... because it sounded like you were yodeling - -oink oink -make up your mind... are you a pig or an owl... get it... because an owl goes who but a pig goes oink... oink - -cows go -no... cows go moo... didn't you know - -jarvis -jarvis... it's me you idiot - -me -no... seriously... it's just me... I was telling a knock knock joke ha ha ha - -madam -my damn foot got stuck in the door, so open it he he he... but actually... I think I hurt my foot - -doris -door is locked... that's why I'm knocking, you idiot - -cash -no thanks... but I would like a peanut instead... get it? because you said cashew... ha ha ha - -orange -orange you glad I am your friend - -alex -I'll ask the questions around here, thank you - -viper -viper nose... it's running - -canoe -can you scratch my back... it itches - -pete -pizza delivery guy... you idiot - -doctor -that is the best show ever - -arizona -arizona room for only one of us in this room - -spider -in spider what everyone says, I still feel like a human diff --git a/client/beep_hi.wav b/client/beep_hi.wav deleted file mode 100644 index 1d6593f..0000000 Binary files a/client/beep_hi.wav and /dev/null differ diff --git a/client/beep_lo.wav b/client/beep_lo.wav deleted file mode 100644 index 0afb29a..0000000 Binary files a/client/beep_lo.wav and /dev/null differ diff --git a/client/mic.py b/client/mic.py index 71f49ab..d746ba1 100644 --- a/client/mic.py +++ b/client/mic.py @@ -237,7 +237,7 @@ class Mic: if THRESHOLD == None: THRESHOLD = self.fetchThreshold() - os.system("aplay -D hw:1,0 beep_hi.wav") + os.system("aplay -D hw:1,0 ../static/audio/beep_hi.wav") # prepare recording stream audio = pyaudio.PyAudio() @@ -267,7 +267,7 @@ class Mic: if average < THRESHOLD * 0.8: break - os.system("aplay -D hw:1,0 beep_lo.wav") + os.system("aplay -D hw:1,0 ../static/audio/beep_lo.wav") # save the audio data stream.stop_stream() @@ -287,7 +287,7 @@ class Mic: return self.transcribe(AUDIO_FILE, MUSIC=True) return self.transcribe(AUDIO_FILE) - + def say(self, phrase, OPTIONS=" -vdefault+m3 -p 40 -s 160 --stdout > say.wav"): # alter phrase before speaking phrase = alteration.clean(phrase) diff --git a/client/modules/Joke.py b/client/modules/Joke.py index 454280c..52b3eb9 100644 --- a/client/modules/Joke.py +++ b/client/modules/Joke.py @@ -4,7 +4,7 @@ import re WORDS = ["JOKE", "KNOCK KNOCK"] -def getRandomJoke(filename="JOKES.txt"): +def getRandomJoke(filename="../static/text/JOKES.txt"): jokeFile = open(filename, "r") jokes = [] start = "" diff --git a/static/audio/beep_hi.wav b/static/audio/beep_hi.wav new file mode 100644 index 0000000..1d6593f Binary files /dev/null and b/static/audio/beep_hi.wav differ diff --git a/static/audio/beep_lo.wav b/static/audio/beep_lo.wav new file mode 100644 index 0000000..0afb29a Binary files /dev/null and b/static/audio/beep_lo.wav differ diff --git a/static/audio/say.wav b/static/audio/say.wav new file mode 100644 index 0000000..d27c7dc Binary files /dev/null and b/static/audio/say.wav differ diff --git a/static/text/JOKES.txt b/static/text/JOKES.txt new file mode 100644 index 0000000..adfb0e3 --- /dev/null +++ b/static/text/JOKES.txt @@ -0,0 +1,47 @@ +little old lady +wow... I didn't know you could yodel... get it... because it sounded like you were yodeling + +oink oink +make up your mind... are you a pig or an owl... get it... because an owl goes who but a pig goes oink... oink + +cows go +no... cows go moo... didn't you know + +jarvis +jarvis... it's me you idiot + +me +no... seriously... it's just me... I was telling a knock knock joke ha ha ha + +madam +my damn foot got stuck in the door, so open it he he he... but actually... I think I hurt my foot + +doris +door is locked... that's why I'm knocking, you idiot + +cash +no thanks... but I would like a peanut instead... get it? because you said cashew... ha ha ha + +orange +orange you glad I am your friend + +alex +I'll ask the questions around here, thank you + +viper +viper nose... it's running + +canoe +can you scratch my back... it itches + +pete +pizza delivery guy... you idiot + +doctor +that is the best show ever + +arizona +arizona room for only one of us in this room + +spider +in spider what everyone says, I still feel like a human -- cgit v1.3.1