how does livekit calculate transcription delay?
# ask-ai
v
how does livekit calculate transcription delay?
t
LiveKit measures the transcription delay by looking at the time between when you finish speaking and when the final transcription of what you said comes through. It uses this simple formula:
Copy code
transcriptionDelay = max(lastFinalTranscriptTime - lastSpeakingTime, 0)
Here’s what each part means: • lastSpeakingTime: This is the moment you stop talking, detected using Voice Activity Detection (VAD). • lastFinalTranscriptTime: This is when the final transcription result arrives from the Speech-to-Text (STT) system. You’ll find this value included in the onEndOfTurn hook inside the EndOfTurnInfo object. It helps show the delay between when you finish speaking and when the transcription is ready for you. If you have any questions about this, I’m here to help! Sources: agents/src/voice/audio_recognition.ts | livekit-agents/livekit/agents/telemetry/trace_types.py | Operational Best Practices | livekit/livekit_composite | DeepWiki | Knowledge Base Content | livekit/livekit_composite | DeepWiki