BUGFIX noisegate

- Froze when leaving and joining
- Add aarch64 option for opus
This commit is contained in:
Logan Cusano
2022-02-06 18:45:25 -05:00
parent 181cbd9180
commit 8525f79878
3 changed files with 43 additions and 10 deletions

View File

@@ -26,9 +26,7 @@ class PCMStream:
return bytes(data)
def change_device(self, num):
if self.stream is not None:
self.stream.stop()
self.stream.close()
self.clean_up()
self.stream = sd.RawInputStream(device=num)
noisegate_obj.init_stream(num, self.voice_connection, self)
@@ -36,6 +34,19 @@ class PCMStream:
self.stream.start()
noisegate_obj.start()
def clean_up(self):
global noisegate_obj
if self.stream is not None:
self.stream.stop()
self.stream.close()
if noisegate_obj.NG_Started.is_set():
print("Closing the noisegate")
noisegate_obj.stop_NG.set()
noisegate_obj.join()
noisegate_obj = NoiseGate()
print("Started the noisegate")
class DeviceNotFoundError(Exception):
def __init__(self):