Skip to content

RSDK-14053 Add Conversation timeout attribute #23

Merged
oliviamiller merged 9 commits into
mainfrom
hot-mic
Jun 8, 2026
Merged

RSDK-14053 Add Conversation timeout attribute #23
oliviamiller merged 9 commits into
mainfrom
hot-mic

Conversation

@oliviamiller

@oliviamiller oliviamiller commented Jun 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds a conversation_timeout_seconds config attribute. After a wake word fires and a segment is yielded, any speech that begins within this window streams through without requiring the wake word again — letting users ask follow-up questions naturally.
  • Sliding window: each yielded segment refreshes the timer, so the conversation stays open as long as the user keeps talking. After the timer expires, the wake word is required again.
  • Works for both OWW (engages on IDLE→ACTIVE transition, streams live) and Vosk (bypasses transcript matching in _run_detection).
  • Default is 0 (disabled) — module behaves as a strict wake-word filter when not configured.

Implementation

  • New _in_conversation_window() / _refresh_conversation_window() helpers using time.monotonic().
  • OWW path: hooks into _process_vad_frame at IDLE→ACTIVE to set oww_detected = True directly, so the existing streaming path engages without an OWW inference hit.
  • Vosk path: branches inside _run_detection to yield buffered chunks + sentinel unconditionally during the window.
  • Refresh fires after every sentinel emit (streaming path, OWW batch path, Vosk match).

Testing

  • 15 new unit tests: validation, init, helper behavior, OWW in/out of window, Vosk bypass, sliding refresh.
  • All 112 tests pass, lint clean.

@oliviamiller oliviamiller requested a review from seanavery June 2, 2026 18:00
speech_segment.speech_chunk_buffer.append(audio_chunk)
speech_segment.speech_buffer.extend(frame)

match (state, is_speech):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Is this new python syntax? Do we need to update anything in pyinstaller or CI to make sure we are building with newer python ver?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

needs python 3.10+, ill update setup.sh to make that explicit

self.detection_engine == "openwakeword"
and self._in_conversation_window()
):
speech_segment.oww_detected = True

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Do we need min_speech_frames check on the oww path?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

min_speech_frames in only meaningful for vosk, meant to avoid running inference on speech segments that are too small

@oliviamiller oliviamiller requested a review from seanavery June 8, 2026 14:44

@seanavery seanavery left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM

@oliviamiller oliviamiller merged commit 95f7b12 into main Jun 8, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants