summaryrefslogtreecommitdiff
path: root/client/mic.py
diff options
context:
space:
mode:
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 2bb8c57..2e8d603 100644
--- a/client/mic.py
+++ b/client/mic.py
@@ -175,6 +175,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
"""
RATE = 16000