Remove mic preroll to avoid speech polution from Hugvey itself

This commit is contained in:
Ruben van de Ven 2019-04-16 10:21:48 +02:00
parent 267b2d980f
commit 72547ae673
1 changed files with 0 additions and 9 deletions

View File

@ -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)