diff options
Diffstat (limited to 'client')
| -rw-r--r-- | client/conversation.py | 16 | ||||
| -rw-r--r-- | client/mic.py | 2 |
2 files changed, 8 insertions, 10 deletions
diff --git a/client/conversation.py b/client/conversation.py index fe3e058..be9b8e9 100644 --- a/client/conversation.py +++ b/client/conversation.py @@ -46,14 +46,12 @@ class Conversation(object): for notif in notifications: print notif - try: - threshold, transcribed = self.mic.passiveListen(self.persona) - except: + threshold, transcribed = self.mic.passiveListen(self.persona) + if not transcribed or not threshold: continue - if threshold: - input = self.mic.activeListen(threshold) - if input: - self.delegateInput(input) - else: - self.mic.say("Pardon?") + input = self.mic.activeListen(threshold) + if input: + self.delegateInput(input) + else: + self.mic.say("Pardon?") diff --git a/client/mic.py b/client/mic.py index 096610d..c0656ce 100644 --- a/client/mic.py +++ b/client/mic.py @@ -138,7 +138,7 @@ class Mic: # no use continuing if no flag raised if not didDetect: print "No disturbance detected" - return + return (None, None) # cutoff any recording before this disturbance was detected frames = frames[-20:] |
