diff --git a/hugvey/client.py b/hugvey/client.py index 0f9fe28..3b5a6ef 100644 --- a/hugvey/client.py +++ b/hugvey/client.py @@ -49,12 +49,13 @@ class VoiceServer(object): self.hugvey = hugvey self.chunk = 4096 - self.mic_prerol_sec = .05 - self.prerol_frame_count = math.ceil(self.input_rate / self.chunk) + self.mic_prerol_sec = .2 + self.prerol_frame_count = math.ceil((self.input_rate / self.chunk) * self.mic_prerol_sec) self.prerol_frames = collections.deque(maxlen = self.prerol_frame_count) self.p = pyaudio.PyAudio() # wait a sec for the input devices to come up + logger.debug("Use a mic prerol of {} frames".format(self.prerol_frame_count)) logger.debug('wait for mic') time.sleep(3) logger.debug('done waiting for mic')