diff options
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"): |
