Skip to content

Commit 8a8ccec

Browse files
committed
Use more obscure implementation using a sub-array dtype
This restores the original behavior of .base pointing directly to the CFFI backend buffer.
1 parent a85f1d2 commit 8a8ccec

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

‎src/sounddevice.py‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2791,9 +2791,7 @@ def _buffer(ptr, frames, channels, samplesize):
27912791
def _array(buffer, channels, dtype):
27922792
"""Create NumPy array from a buffer object."""
27932793
import numpy as np
2794-
data = np.frombuffer(buffer, dtype=dtype)
2795-
data = np.reshape(data, (-1, channels), copy=False)
2796-
return data
2794+
return np.frombuffer(buffer, dtype=np.dtype((dtype, (channels,))))
27972795

27982796

27992797
def _split(value):

0 commit comments

Comments
 (0)