Skip to content

Commit

Permalink
fix: IndexError on tts metrics (#1028)
Browse files Browse the repository at this point in the history
  • Loading branch information
theomonnom authored Nov 2, 2024
1 parent 5fb1e84 commit 670b2ae
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/unlucky-bananas-run.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"livekit-agents": patch
---

fix: IndexError on tts metrics
3 changes: 3 additions & 0 deletions livekit-agents/livekit/agents/tts/tts.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,9 @@ def _emit_metrics():
nonlocal start_time, audio_duration, ttfb, request_id
duration = time.perf_counter() - start_time

if not self._mtc_pending_texts:
return

text = self._mtc_pending_texts.pop(0)
if not text:
return
Expand Down

0 comments on commit 670b2ae

Please sign in to comment.