Skip to content

Commit 2564809

Browse files
committed
fix doctest
1 parent 57cd3e3 commit 2564809

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

getstream/video/rtc/track_util.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1411,10 +1411,14 @@ class Resampler:
14111411
of stateful resamplers.
14121412
14131413
Example:
1414+
>>> import numpy as np
14141415
>>> resampler = Resampler(format="s16", sample_rate=48000, channels=1)
14151416
>>> # Process 20ms chunks at 16kHz (320 samples each)
1417+
>>> samples = np.zeros(320, dtype=np.int16)
14161418
>>> pcm_16k = PcmData(samples=samples, sample_rate=16000, format="s16", channels=1)
14171419
>>> pcm_48k = resampler.resample(pcm_16k) # Returns 960 samples at 48kHz
1420+
>>> len(pcm_48k.samples)
1421+
960
14181422
"""
14191423

14201424
def __init__(self, format: str, sample_rate: int, channels: int):

0 commit comments

Comments
 (0)