Closed mgeier closed 8 years ago
stop
waits for all queued samples to play. This is necessary in __exit__()
, else
with Stream(...) as s:
s.write(...)
would abort as soon as s.write()
returns, which is one block length before all samples are played.
close
in contrast is equivalent to abort
and will not wait for queued samples to play.
I'm not quite sure, but it seems more sensible to only call
self.close()
in__exit__()
.I don't even know the implications of the call to
stop()
. Either it is "superseded" by the following call toclose()
, in which case it would be superfluous. Or it blocks until all pending buffers are played out, which is probably not what you expect from__exit__()
.