Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/sounddevice.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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:
Expand All @@ -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)
Expand Down