famous-needle-51751
08/14/2025, 2:23 AMaudio_duration metric is reported as 5s consistently? can't tell if this is a bug in livekit or if we've somehow misconfigured something causing 5s to be buffered and sent instead of streaming live audiotall-airline-16756
08/14/2025, 2:23 AMtall-airline-16756
08/14/2025, 2:24 AMaudio_duration metric reported every 5 seconds is because LiveKit uses a periodic reporting setup. Specifically, the SpeechStream class relies on a PeriodicCollector that collects and sends metrics like audio_duration in 5-second chunks.
If you’re worried something might be off, it’s a good idea to double-check that your audio is streaming properly to LiveKit. But just so you know, this 5-second reporting interval is actually the default and usually not a sign of any problem.
Now, if you want to change how often the metrics get reported, you’d need to tweak the PeriodicCollector timing inside the SpeechStream code. Feel free to reach out if you want a hand with that or have any other questions—I’m here to help!
Sources: STTMetrics | LiveKit Agents | livekit-agents/livekit/agents/metrics/base.py