Skip to content
This repository has been archived by the owner on Sep 8, 2024. It is now read-only.

Commit

Permalink
Merge pull request #2542 from forslund/bugfix/mute-before-lock
Browse files Browse the repository at this point in the history
Move mute stage of __init__() after creating lock
  • Loading branch information
forslund authored Apr 20, 2020
2 parents c8c416d + 7586de8 commit 0214b76
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mycroft/client/speech/mic.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ def __init__(self, wrapped_stream, format, muted=False):
assert wrapped_stream is not None
self.wrapped_stream = wrapped_stream

self.muted = muted
if muted:
self.mute()

self.SAMPLE_WIDTH = pyaudio.get_sample_size(format)
self.muted_buffer = b''.join([b'\x00' * self.SAMPLE_WIDTH])
self.read_lock = Lock()

self.muted = muted
if muted:
self.mute()

def mute(self):
"""Stop the stream and set the muted flag."""
with self.read_lock:
Expand Down

0 comments on commit 0214b76

Please sign in to comment.