From 72547ae6734a9f91b1a0c7ce9b6a8652115521f0 Mon Sep 17 00:00:00 2001 From: Ruben van de Ven Date: Tue, 16 Apr 2019 10:21:48 +0200 Subject: [PATCH] Remove mic preroll to avoid speech polution from Hugvey itself --- hugvey/client.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/hugvey/client.py b/hugvey/client.py index fb3ce96..87811fe 100644 --- a/hugvey/client.py +++ b/hugvey/client.py @@ -161,18 +161,9 @@ class VoiceServer(object): if self.hugvey.cmd_server.muteMic: logger.debug('block recording {}' .format( self.hugvey.cmd_server.muteMic)) - - # if recording is blocked, store the latest n frames. So we can release - # this buffer to the mic stream - self.prerol_frames.append(f) # multiply by 0 to disable audio recording while playback f = audioop.mul(f, 2, 0) - elif len(self.prerol_frames) > 0: - self.prerol_frames.append(f) - f = b''.join(self.prerol_frames) - self.prerol_frames.clear() - logger.info('used buffer, len now {}'.format(len(f))) self.loop.call_soon_threadsafe(self.voice_socket.send, f)