We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b780a2f commit 4d52471Copy full SHA for 4d52471
1 file changed
sounddevice.py
@@ -587,6 +587,26 @@ def get_status():
587
raise RuntimeError('play()/rec()/playrec() was not called yet')
588
589
590
+def get_stream():
591
+ """Get a reference to the current stream.
592
+
593
+ This applies only to streams created by calls to `play()`, `rec()`,
594
+ or `playrec()`.
595
596
+ Returns
597
+ -------
598
+ Stream
599
+ An `OutputStream`, `InputStream`, or `Stream` associated with
600
+ the last invocation of `play()`, `rec()` or `playrec()`
601
+ respectively.
602
603
+ """
604
+ if _last_callback:
605
+ return _last_callback.stream
606
+ else:
607
+ raise RuntimeError('play()/rec()/playrec() was not called yet')
608
609
610
def query_devices(device=None, kind=None):
611
"""Return information about available devices.
612
0 commit comments