diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2014-03-30 16:03:44 -0400 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2014-03-30 16:03:44 -0400 |
| commit | d31fabf8cff5dae02e3fc759a4203bd374dddc99 (patch) | |
| tree | 888ec4e6d98154f862a3b9cd17a3394b657bc02e /client/local_mic.py | |
| parent | 4182b5e096e081158dddd4ad5d031af94fcc63de (diff) | |
| download | jasper-client-d31fabf8cff5dae02e3fc759a4203bd374dddc99.tar.gz jasper-client-d31fabf8cff5dae02e3fc759a4203bd374dddc99.zip | |
Initial commit
Diffstat (limited to 'client/local_mic.py')
| -rw-r--r-- | client/local_mic.py | 26 |
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 |
