MCPcopy Create free account
hub / github.com/livekit/agents / _frame

Function _frame

tests/test_utils/test_audio_array_buffer.py:12–16  ·  view source on GitHub ↗
(samples: list[int], *, sr: int = 16000, ch: int = 1)

Source from the content-addressed store, hash-verified

10
11
12def _frame(samples: list[int], *, sr: int = 16000, ch: int = 1) -> rtc.AudioFrame:
13 data = np.array(samples, dtype=np.int16).tobytes()
14 return rtc.AudioFrame(
15 data=data, sample_rate=sr, num_channels=ch, samples_per_channel=len(samples) // ch
16 )
17
18
19def _stereo(left: list[int], right: list[int], *, sr: int = 16000) -> rtc.AudioFrame:

Callers 15

test_push_and_readMethod · 0.85
test_too_large_raisesMethod · 0.85
test_stereo_then_monoMethod · 0.85
test_shiftMethod · 0.85
test_shift_then_pushMethod · 0.85
test_returns_copyMethod · 0.85
test_dtype_preservedMethod · 0.85
test_full_replacementMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected