Skip to content

Commit 03691b3

Browse files
authored
normalize memoryview format to bytes in AudioFrame (#581)
1 parent f0e2171 commit 03691b3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

livekit-rtc/livekit/rtc/audio_frame.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ def __init__(
4949
Raises:
5050
ValueError: If the length of `data` is smaller than the required size.
5151
"""
52+
if isinstance(data, memoryview):
53+
data = data.cast("B")
54+
5255
data = _ensure_compatible_buffer(data)
5356

5457
min_size = num_channels * samples_per_channel * ctypes.sizeof(ctypes.c_int16)

0 commit comments

Comments
 (0)