summaryrefslogtreecommitdiff
path: root/client/mic.py
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2014-08-23 09:10:37 +0800
committerschneefux <schneefux+commit@schneefux.xyz>2014-08-23 09:10:37 +0800
commitbd72c31b6e9e08c03198c106c49ebf904a50a9cb (patch)
tree4e9eceeb7143418af90836645d702d556d0444f2 /client/mic.py
parent0d4bb63b3727e44c973d167be0d82c4c062648f6 (diff)
downloadjasper-client-bd72c31b6e9e08c03198c106c49ebf904a50a9cb.tar.gz
jasper-client-bd72c31b6e9e08c03198c106c49ebf904a50a9cb.zip
More cleanup, mostly in docstrings
Diffstat (limited to 'client/mic.py')
-rw-r--r--client/mic.py19
1 files changed, 9 insertions, 10 deletions
diff --git a/client/mic.py b/client/mic.py
index abd16a3..01a37cb 100644
--- a/client/mic.py
+++ b/client/mic.py
@@ -16,12 +16,12 @@ class Mic:
def __init__(self, speaker, passive_stt_engine, active_stt_engine):
"""
- Initiates the pocketsphinx instance.
+ Initiates the pocketsphinx instance.
- Arguments:
- speaker -- handles platform-independent audio output
- passive_stt_engine -- performs STT while Jasper is in passive listen mode
- acive_stt_engine -- performs STT while Jasper is in active listen mode
+ Arguments:
+ speaker -- handles platform-independent audio output
+ passive_stt_engine -- performs STT while Jasper is in passive listen mode
+ acive_stt_engine -- performs STT while Jasper is in active listen mode
"""
self.speaker = speaker
self.passive_stt_engine = passive_stt_engine
@@ -34,7 +34,7 @@ class Mic:
def fetchThreshold(self):
- # TODO: Consolidate all of these variables from the next three functions
+ # TODO: Consolidate variables from the next three functions
THRESHOLD_MULTIPLIER = 1.8
RATE = 16000
CHUNK = 1024
@@ -74,8 +74,8 @@ class Mic:
def passiveListen(self, PERSONA):
"""
- Listens for PERSONA in everyday sound
- Times out after LISTEN_TIME, so needs to be restarted
+ Listens for PERSONA in everyday sound. Times out after LISTEN_TIME, so needs to be
+ restarted.
"""
THRESHOLD_MULTIPLIER = 1.8
@@ -200,8 +200,7 @@ class Mic:
frames_per_buffer=CHUNK)
frames = []
- # increasing the range # results in longer pause after command
- # generation
+ # increasing the range # results in longer pause after command generation
lastN = [THRESHOLD * 1.2 for i in range(30)]
for i in range(0, RATE / CHUNK * LISTEN_TIME):