rhythmic-furniture-71949
08/19/2025, 8:48 PMtall-airline-16756
08/19/2025, 8:48 PMtall-airline-16756
08/19/2025, 8:48 PMrhythmic-furniture-71949
08/19/2025, 8:49 PMtall-airline-16756
08/19/2025, 8:50 PMrhythmic-furniture-71949
08/19/2025, 8:50 PMrhythmic-furniture-71949
08/19/2025, 8:51 PMtall-airline-16756
08/19/2025, 8:52 PMAudioResampler
in Python to help you out:
from livekit import rtc
# Create a resampler to convert from 8000 Hz to 24000 Hz
resampler = rtc.AudioResampler(
input_rate=8000,
output_rate=24000,
num_channels=1,
quality=rtc.AudioResamplerQuality.MEDIUM
)
# Resample your 8000 Hz audio frames
def resample_audio_frame(audio_frame_8khz):
resampled_frames = resampler.push(audio_frame_8khz)
return resampled_frames
After resampling, you can go ahead and send the audio to the RealtimeModel just like usual. If you run into any hiccups or want to chat more about this, I’m here to help—just let me know!
Sources: plugins/openai/src/realtime/api_proto.ts | livekit-plugins/livekit-plugins-aws/livekit/plugins/aws/experimental/realti... | livekit-rtc/livekit/rtc/audio_resampler.py | RealtimeModel | LiveKit Agents