Error catching
- PCMStream.clean_up - PCMStream.read
This commit is contained in:
4
sound.py
4
sound.py
@@ -22,7 +22,7 @@ class PCMStream:
|
||||
|
||||
# convert to pcm format
|
||||
return bytes(data)
|
||||
except sounddevice.PortAudioError as err:
|
||||
except Exception as err:
|
||||
print(f"Error in PCMStream.read: '{err}'")
|
||||
|
||||
def change_device(self, device_ID):
|
||||
@@ -39,7 +39,7 @@ class PCMStream:
|
||||
|
||||
self.stream.close()
|
||||
|
||||
except sounddevice.PortAudioError as err:
|
||||
except Exception as err:
|
||||
print(f"Error in PCMStream.clean_up: '{err}'")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user