diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2014-08-30 17:44:47 +0100 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2014-09-25 07:12:55 +0100 |
| commit | dd133d3738162e184f206d112ea4a39ba43f0781 (patch) | |
| tree | e1ac1e02cd601c1908d93bea974e19433297c958 /client/mic.py | |
| parent | ea3026c133755bf3e35ad78fa253786bc9ff7c36 (diff) | |
| download | jasper-client-dd133d3738162e184f206d112ea4a39ba43f0781.tar.gz jasper-client-dd133d3738162e184f206d112ea4a39ba43f0781.zip | |
Handle all Google Speech options
Diffstat (limited to 'client/mic.py')
| -rw-r--r-- | client/mic.py | 13 |
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" |
