Skip to content
Open
Show file tree
Hide file tree
Changes from 2 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
2 changes: 2 additions & 0 deletions livekit-agents/livekit/agents/voice/agent_activity.py
Original file line number Diff line number Diff line change
Expand Up @@ -1005,6 +1005,8 @@ def push_audio(self, frame: rtc.AudioFrame) -> None:

should_discard = (
self._current_speech
and not self._current_speech.done()
and not self._current_speech.interrupted
and not self._current_speech.allow_interruptions
and self._session.options.interruption["discard_audio_if_uninterruptible"]
) or (
Expand Down
10 changes: 10 additions & 0 deletions livekit-agents/livekit/agents/voice/audio_recognition.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,9 @@ def __init__(

self._vad_speech_started: bool = False

# skip stt warning
self._skip_stt_warning_started: bool = False

def update_options(
self,
*,
Expand Down Expand Up @@ -512,6 +515,13 @@ def push_audio(self, frame: rtc.AudioFrame, *, skip_stt: bool = False) -> None:
if not skip_stt and self._stt_pipeline is not None:
self._stt_pipeline.audio_ch.send_nowait(frame)

# warn once per skipping window
if skip_stt and not self._skip_stt_warning_started:
self._skip_stt_warning_started = True
logger.warning("skipping stt due to aec warmup or discard_audio_if_uninterruptible")
elif not skip_stt and self._skip_stt_warning_started:
self._skip_stt_warning_started = False

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we move this to the agent activity and add both logs for discard started and ended?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed this to info too. Since normally it is expected when aec or discard are enabled.

if self._vad_ch is not None:
self._vad_ch.send_nowait(frame)

Expand Down
Loading