summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Geier <Matthias.Geier@gmail.com>2017-08-19 17:09:35 +0200
committerMatthias Geier <Matthias.Geier@gmail.com>2017-08-19 17:09:35 +0200
commit8370db2cf4ff08a23119824f2cecd08ad15a1165 (patch)
tree7a984e6f824280431f7d9e226718da942112182c
parentabf1f19839059453436738d8d2979d22772c101c (diff)
Add .closed property
-rw-r--r--sounddevice.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/sounddevice.py b/sounddevice.py
index 1f515f7..4152aa8 100644
--- a/sounddevice.py
+++ b/sounddevice.py
@@ -1181,6 +1181,11 @@ class _StreamBase(object):
return _check(_lib.Pa_IsStreamStopped(self._ptr)) == 1
@property
+ def closed(self):
+ """``True`` after a call to `close()`, ``False`` otherwise."""
+ return self._ptr == _ffi.NULL
+
+ @property
def time(self):
"""The current stream time in seconds.