Error catching for cleaning up

This commit is contained in:
Logan Cusano
2022-02-27 17:14:31 -05:00
parent 59a3ca22ea
commit 002288d632

View File

@@ -30,8 +30,15 @@ class PCMStream:
def clean_up(self):
if self.stream is not None:
self.stream.stop()
self.stream.close()
try:
self.stream.stop()
except Exception as e:
print(f"Error on Stop: '{e}'")
try:
self.stream.close()
except Exception as e:
print(f"Error on Close: '{e}'")
class DeviceNotFoundError(Exception):