diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2014-08-22 09:32:35 +0800 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2014-08-22 09:32:35 +0800 |
| commit | 0d4bb63b3727e44c973d167be0d82c4c062648f6 (patch) | |
| tree | 2cbdddfc90fef1c345582b576dd5c45da84f46d7 /client/mic.py | |
| parent | 71ac7e8d50a3bc9ee814f334b938cda336377d4f (diff) | |
| download | jasper-client-0d4bb63b3727e44c973d167be0d82c4c062648f6.tar.gz jasper-client-0d4bb63b3727e44c973d167be0d82c4c062648f6.zip | |
Minor style fixes: removed unused imports, commented-out code, etc.
Diffstat (limited to 'client/mic.py')
| -rw-r--r-- | client/mic.py | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/client/mic.py b/client/mic.py index b4ef668..abd16a3 100644 --- a/client/mic.py +++ b/client/mic.py @@ -3,7 +3,6 @@ """ import os -import json from wave import open as open_audio import audioop import pyaudio @@ -35,19 +34,14 @@ class Mic: def fetchThreshold(self): - # TODO: Consolidate all of these variables from the next three - # functions + # TODO: Consolidate all of these variables from the next three functions THRESHOLD_MULTIPLIER = 1.8 - AUDIO_FILE = "passive.wav" RATE = 16000 CHUNK = 1024 # number of seconds to allow to establish threshold THRESHOLD_TIME = 1 - # number of seconds to listen before forcing restart - LISTEN_TIME = 10 - # prepare recording stream audio = pyaudio.PyAudio() stream = audio.open(format=pyaudio.paInt16, @@ -180,7 +174,7 @@ class Mic: """ AUDIO_FILE = "active.wav" - RATE = 16000 + RATE = 16000 CHUNK = 1024 LISTEN_TIME = 12 @@ -238,9 +232,6 @@ class Mic: write_frames.writeframes(''.join(frames)) write_frames.close() - # DO SOME AMPLIFICATION - # os.system("sox "+AUDIO_FILE+" temp.wav vol 20dB") - return self.active_stt_engine.transcribe(AUDIO_FILE, MUSIC) def say(self, phrase, OPTIONS=" -vdefault+m3 -p 40 -s 160 --stdout > say.wav"): |
