big-controller-60015
07/13/2025, 10:41 PMtall-airline-16756
07/13/2025, 10:41 PMtall-airline-16756
07/13/2025, 10:42 PMAudioCustomProcessingDelegate
and assign it to AudioManager.shared.capturePostProcessingDelegate
. This allows you to modify the audio buffer in-place before it is passed to downstream components, including VAD. For example:
class CustomAudioProcessor: AudioCustomProcessingDelegate {
func audioProcessingProcess(audioBuffer: LKAudioBuffer) {
// Your audio processing logic here
}
}
AudioManager.shared.capturePostProcessingDelegate = CustomAudioProcessor()
• Python Agents Framework: Apply your custom audio preprocessing in either a custom STT node or before feeding audio to VAD. Preprocess each audio frame in a generator/coroutine, and then yield the processed frames to the VAD or to STT logic that uses VAD internally.
async def preprocessed_audio():
async for audio_event in audio_stream:
processed_frame = apply_audio_processing(audio_event.frame)
yield processed_frame
# Then feed preprocessed_audio() to VAD
• Key considerations: Processing must be in real-time and maintain proper sample rate expected by VAD (typically 8kHz or 16kHz). Buffer management is crucial for minimizing latency and preserving VAD accuracy.
Let me know if you need implementation details or examples for a specific platform or use case.
Sources: plugins/silero/src/vad.ts | livekit-plugins/livekit-plugins-silero/livekit/plugins/silero/vad.py | Sources/LiveKit/Audio/Manager/AudioManager.swift