Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions livekit-agents/livekit/agents/voice/audio_recognition.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ async def _on_stt_event(self, ev: stt.SpeechEvent) -> None:
self._audio_preflight_transcript = ""
self._final_transcript_received.set()

if not self._vad or self._last_speaking_time == 0:
if not self._vad or self._last_speaking_time is None:
# vad disabled, use stt timestamp
# TODO: this would screw up transcription latency metrics
# but we'll live with it for now.
Expand Down Expand Up @@ -425,7 +425,7 @@ async def _on_stt_event(self, ev: stt.SpeechEvent) -> None:
self._audio_preflight_transcript = (self._audio_transcript + " " + transcript).lstrip()
self._audio_interim_transcript = transcript

if not self._vad or self._last_speaking_time == 0:
if not self._vad or self._last_speaking_time is None:
# vad disabled, use stt timestamp
self._last_speaking_time = time.time()

Expand All @@ -449,7 +449,8 @@ async def _on_stt_event(self, ev: stt.SpeechEvent) -> None:

self._speaking = False
self._user_turn_committed = True
self._last_speaking_time = time.time()
if not self._vad or self._last_speaking_time is None:
self._last_speaking_time = time.time()

chat_ctx = self._hooks.retrieve_chat_ctx().copy()
self._run_eou_detection(chat_ctx)
Expand Down
2 changes: 0 additions & 2 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.