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

Move mute stage of __init__() after creating lock #2542

Merged
merged 1 commit into from
Apr 20, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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