most-receptionist-39338
10/14/2025, 1:22 PMtall-airline-16756
10/14/2025, 1:22 PMtall-airline-16756
10/14/2025, 1:24 PMmost-receptionist-39338
10/14/2025, 1:29 PMtall-airline-16756
10/14/2025, 1:30 PMmost-receptionist-39338
10/14/2025, 1:35 PMtall-airline-16756
10/14/2025, 1:35 PMAudioSource.captureFrame().
• Rust SDK: Using a WavReader, you can read and push audio frames into a NativeAudioSource.
• Swift SDK: You can work with custom audio buffers (AVAudioPCMBuffer) to mix or replace the microphone input.
Just a heads-up: make sure your audio file is properly chunked (for example, into 20ms frames) and matches the expected format (16kHz mono PCM) to ensure everything works smoothly. If the file’s format is different, you might need to resample it.
If you’d like, I’m here to help with specific guidance tailored to your use case or SDK—just let me know!
Sources: Camera & microphone | LiveKit Docs | examples/publish-wav/index.ts | examples/play_from_disk/change-sophie.wav | Docs/audio.md | Processing raw media tracks | LiveKit Docsmost-receptionist-39338
10/14/2025, 1:37 PMtall-airline-16756
10/14/2025, 1:39 PMmost-receptionist-39338
10/14/2025, 2:17 PMtall-airline-16756
10/14/2025, 2:18 PMAudioResampler component from LiveKit OSS to handle the actual resampling.
Here’s a friendly breakdown of how it works:
• The Agent backend takes care of managing the resampling process, making sure audio frames are converted to the right format (like 16kHz mono).
• The AudioResampler from LiveKit OSS does the technical resampling, relying on the Sox resampling library to ensure the conversion is top quality.
• Whenever the input sample rate doesn’t match the needed output rate, resampling kicks in and is smoothly managed during the audio processing pipeline.
If you have any questions or want me to explain anything in more detail, please don’t hesitate to ask—I’m here to help!
Sources: livekit-agents/livekit/agents/voice/room_io/_input.py | AI Agents Framework | livekit/livekit_composite | DeepWiki | livekit-rtc/livekit/rtc/audio_resampler.py | Agent Session & Activity Management | livekit/livekit_composite | DeepWiki | Processing raw media tracks | LiveKit Docs