Possible fix for Nonetype error on Greada

This commit is contained in:
Logan Cusano
2022-03-27 01:16:53 -04:00
parent 22d6d5d3d7
commit cf79050b96

View File

@@ -147,16 +147,16 @@ class NoiseGateStream(discord.AudioSource):
if buffer_decibel >= self.stream.THRESHOLD:
self.NG_fadeout_count = self.NG_fadeout
self.process_set_count += 1
return bytes(curr_buffer)
if curr_buffer:
return bytes(curr_buffer)
else:
if self.NG_fadeout_count > 0:
self.NG_fadeout_count -= 1
print(f"Frames in fadeout remaining: {self.NG_fadeout_count}")
self.process_set_count += 1
return bytes(curr_buffer)
if curr_buffer:
return bytes(curr_buffer)
except OSError as e:
pass