From 9af4e43a387e312e1c79e35eacb65b138b816c83 Mon Sep 17 00:00:00 2001 From: Matthias Geier Date: Sat, 19 Aug 2017 17:15:16 +0200 Subject: For .active property, check for .closed first This way, a closed stream can be active==False instead of throwing an exception. --- sounddevice.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sounddevice.py b/sounddevice.py index 4152aa8..08ce34c 100644 --- a/sounddevice.py +++ b/sounddevice.py @@ -1162,6 +1162,8 @@ class _StreamBase(object): stopped """ + if self.closed: + return False return _check(_lib.Pa_IsStreamActive(self._ptr)) == 1 @property -- cgit v1.2.3