BUGFIX noisegate
- Froze when leaving and joining - Add aarch64 option for opus
This commit is contained in:
17
sound.py
17
sound.py
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user