How to implement custom turn detection plugin for ...
# ask-ai
n
How to implement custom turn detection plugin for audio based turn detection where turn detection model gets audio as input
t
Thanks for reaching out, Tareq. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
LiveKit's current turn detection system works with text transcripts generated from speech-to-text (STT) processes, rather than raw audio input. This means that creating a custom turn detection plugin for audio-based detection isn't directly supported right now because of how the system is built. The
_TurnDetector
interface is designed to work with text input, and there isn’t a public interface to add a model that processes raw audio frames just yet. That said, here are some options you might find helpful: • Use STT Providers with Advanced Endpointing: Some STT providers, like AssemblyAI, offer built-in endpointing models that leverage both audio and linguistic cues to detect turn boundaries. You can set up LiveKit to take advantage of these features. • Combine Realtime Models with Custom Logic: Consider using a multimodal LLM alongside a parallel STT pipeline to manage transcription and turn detection separately. • Custom VAD with Heuristics: You might combine Silero VAD with your own rules (like pause duration or pitch trends) to mimic audio-aware behavior. The great news is that LiveKit is actively working on an audio-based turn detection model that will analyze not just what is said but how it’s said, using prosodic features. Until that’s ready, you can keep an eye on updates through the LiveKit blog or GitHub repository. We’re here to support you along the way! Sources: agents/src/voice/audio_recognition.ts | AssemblyAI plugin guide | LiveKit Docs | Improving voice AI's turn detection with transformers | livekit-plugins/livekit-plugins-turn-detector/livekit/plugins/turn_detector...