summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2014-09-12 21:11:45 +0200
committerschneefux <schneefux+commit@schneefux.xyz>2014-09-12 21:11:45 +0200
commit83d5e2ebea4bbc14d561b7b3dd1774bd7d87f2fb (patch)
treeb5c412e89181b37aeadfaf556d816292c4175c4f
parent013d42ca921432ac5513d9c9b2427b3ffe0bb8a0 (diff)
downloadjasper-client-83d5e2ebea4bbc14d561b7b3dd1774bd7d87f2fb.tar.gz
jasper-client-83d5e2ebea4bbc14d561b7b3dd1774bd7d87f2fb.zip
Remove general try except block
-rw-r--r--client/conversation.py16
-rw-r--r--client/mic.py2
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:]