summaryrefslogtreecommitdiff
path: root/client/local_mic.py
diff options
context:
space:
mode:
Diffstat (limited to 'client/local_mic.py')
-rw-r--r--client/local_mic.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/client/local_mic.py b/client/local_mic.py
new file mode 100644
index 0000000..3fc742e
--- /dev/null
+++ b/client/local_mic.py
@@ -0,0 +1,26 @@
+"""
+A drop-in replacement for the Mic class that allows for all I/O to occur
+over the terminal. Useful for debugging. Unlike with the typical Mic
+implementation, Jasper is always active listening with local_mic.
+"""
+
+
+class Mic:
+ prev = None
+
+ def __init__(self, lmd, dictd, lmd_persona, dictd_persona):
+ return
+
+ def passiveListen(self, PERSONA):
+ return True, "JASPER"
+
+ def activeListen(self, THRESHOLD=None, LISTEN=True, MUSIC=False):
+ if not LISTEN:
+ return self.prev
+
+ input = raw_input("YOU: ")
+ self.prev = input
+ return input
+
+ def say(self, phrase, OPTIONS=None):
+ print "JASPER: " + phrase