Skip to content

Commit 9796c09

Browse files
Refactor _wrap_callback to accept variable arguments from duplex
1 parent 2b2ecdd commit 9796c09

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/sounddevice.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2770,12 +2770,13 @@ def _get_stream_parameters(kind, device, channels, dtype, latency,
27702770
return parameters, dtype, samplesize, samplerate
27712771

27722772

2773-
def _wrap_callback(callback, data, frames, time, status):
2773+
def _wrap_callback(callback, *args):
27742774
"""Invoke callback function and check for custom exceptions."""
27752775
cf = CallbackFlags.__new__(CallbackFlags)
2776-
cf._flags = int(status)
2776+
cf._flags = int(args[-1])
2777+
args = args[:-1] + (cf,)
27772778
try:
2778-
callback(data, frames, time, cf)
2779+
callback(*args)
27792780
except CallbackStop:
27802781
return _lib.paComplete
27812782
except CallbackAbort:

0 commit comments

Comments
 (0)