diff --git a/NoiseGatev2.py b/NoiseGatev2.py index cfe802c..0d855f1 100644 --- a/NoiseGatev2.py +++ b/NoiseGatev2.py @@ -132,7 +132,7 @@ class NoiseGateStream(discord.AudioSource): def __init__(self, _stream): super(NoiseGateStream, self).__init__() self.stream = _stream # The actual audio stream object - self.NG_fadeout = 480/20 # Fadeout value used to hold the noisegate after de-triggering + self.NG_fadeout = 240/20 # Fadeout value used to hold the noisegate after de-triggering self.NG_fadeout_count = 0 # A count set when the noisegate is triggered and was de-triggered self.process_set_count = 0 # Counts how many processes have been made in order to limit the prints @@ -159,6 +159,8 @@ class NoiseGateStream(discord.AudioSource): LOGGER.debug(f"Frames in fadeout remaining: {self.NG_fadeout_count}") self.process_set_count += 1 if curr_buffer: + if self.NG_fadeout_count == 0: + voice_connection.stop() return bytes(curr_buffer) except OSError as e: diff --git a/TODO.md b/TODO.md index 3c1fd84..d763e7a 100644 --- a/TODO.md +++ b/TODO.md @@ -8,6 +8,7 @@ - [x] Add method for user to change audio device without redoing entire config file - [ ] Clean up code - [ ] Transcode radio transmissions to text +- [ ] Need to create toggle/selection for OP25 debug mode ### Modules #### Willie Timer - [ ] Get more training data for WillieTimer diff --git a/op25Handler.py b/op25Handler.py index 12c8dec..a1f31de 100644 --- a/op25Handler.py +++ b/op25Handler.py @@ -66,8 +66,7 @@ class OP25Handler(threading.Thread): self.logger.debug(f"OP25 Keyword Args: {p25_kwargs}") - self.OP25Proc = subprocess.Popen(p25_kwargs, executable=self.OP25EXE, shell=False, stdin=subprocess.PIPE, - stdout=subprocess.PIPE, stderr=subprocess.STDOUT, cwd=self.OP25Dir) + self.OP25Proc = subprocess.Popen(p25_kwargs, executable=self.OP25EXE, shell=False, cwd=self.OP25Dir) def close_op25(self): self.logger.info(f"Closing OP25")