From 8370db2cf4ff08a23119824f2cecd08ad15a1165 Mon Sep 17 00:00:00 2001 From: Matthias Geier Date: Sat, 19 Aug 2017 17:09:35 +0200 Subject: Add .closed property --- sounddevice.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sounddevice.py b/sounddevice.py index 1f515f7..4152aa8 100644 --- a/sounddevice.py +++ b/sounddevice.py @@ -1180,6 +1180,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. -- cgit v1.2.3