summaryrefslogtreecommitdiff
path: root/client/mic.py
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2014-09-26 16:58:07 +0200
committerschneefux <schneefux+commit@schneefux.xyz>2014-09-26 16:58:07 +0200
commitcb0eb4742347c7d8c692342bc4c0e37a95ffaa51 (patch)
treeaef2f60d1f446f4ebd296f7c6597a2dca06747fb /client/mic.py
parentba7df0c17b633e28502db384743856f050d934c0 (diff)
parentdd133d3738162e184f206d112ea4a39ba43f0781 (diff)
downloadjasper-client-cb0eb4742347c7d8c692342bc4c0e37a95ffaa51.tar.gz
jasper-client-cb0eb4742347c7d8c692342bc4c0e37a95ffaa51.zip
Merge pull request #148 from alexsiri7/multiple_queries
Handle all Google Speech options
Diffstat (limited to 'client/mic.py')
-rw-r--r--client/mic.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/client/mic.py b/client/mic.py
index 6c428c0..0351592 100644
--- a/client/mic.py
+++ b/client/mic.py
@@ -172,6 +172,19 @@ class Mic:
def activeListen(self, THRESHOLD=None, LISTEN=True, MUSIC=False):
"""
Records until a second of silence or times out after 12 seconds
+
+ Returns the first matching string or None
+ """
+
+ options = self.activeListenToAllOptions(THRESHOLD, LISTEN, MUSIC)
+ if options:
+ return options[0]
+
+ def activeListenToAllOptions(self, THRESHOLD=None, LISTEN=True, MUSIC=False):
+ """
+ Records until a second of silence or times out after 12 seconds
+
+ Returns a list of the matching options or None
"""
AUDIO_FILE = "active.wav"