Skip to content

Commit a4efc88

Browse files
committed
normalize memoryview format to bytes in AudioFrame
1 parent d58fb8b commit a4efc88

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)