Skip to content

Commit ac6f13e

Browse files
committed
wip
1 parent 4a010f9 commit ac6f13e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

livekit-rtc/livekit/rtc/audio_frame.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,10 @@ def __init__(
5959
# can happen if data is bigger than needed
6060
raise ValueError("data length must be a multiple of sizeof(int16)")
6161

62+
data = memoryview(data).cast("B")
6263
self._data = (ctypes.c_int16 * (len(data) // ctypes.sizeof(ctypes.c_int16)))()
63-
ctypes.memmove(self._data, bytes(data), len(data))
64+
ctypes.memmove(self._data, data, len(data))
65+
6466
self._sample_rate = sample_rate
6567
self._num_channels = num_channels
6668
self._samples_per_channel = samples_per_channel

0 commit comments

Comments
 (0)