diff --git a/src/sounddevice.py b/src/sounddevice.py index 00fc6f8..86a6f03 100644 --- a/src/sounddevice.py +++ b/src/sounddevice.py @@ -1927,7 +1927,7 @@ class CallbackFlags: __slots__ = '_flags' def __init__(self, flags=0x0): - self._flags = flags + self._flags = int(flags) def __repr__(self): flags = str(self) @@ -2772,7 +2772,9 @@ def _get_stream_parameters(kind, device, channels, dtype, latency, def _wrap_callback(callback, *args): """Invoke callback function and check for custom exceptions.""" - args = args[:-1] + (CallbackFlags(args[-1]),) + cf = CallbackFlags.__new__(CallbackFlags) + cf._flags = int(args[-1]) + args = args[:-1] + (cf,) try: callback(*args) except CallbackStop: @@ -2781,7 +2783,6 @@ def _wrap_callback(callback, *args): return _lib.paAbort return _lib.paContinue - def _buffer(ptr, frames, channels, samplesize): """Create a buffer object from a pointer to some memory.""" return _ffi.buffer(ptr, frames * channels * samplesize)