Skip to content

Stream OWW in real time#22

Open
oliviamiller wants to merge 1 commit into
viam-modules:mainfrom
oliviamiller:add-stream-mode
Open

Stream OWW in real time#22
oliviamiller wants to merge 1 commit into
viam-modules:mainfrom
oliviamiller:add-stream-mode

Conversation

@oliviamiller
Copy link
Copy Markdown
Collaborator

Summary

  • Adds streaming output for OpenWakeWord: after detection fires mid-segment, chunks flush
    from the buffer and subsequent chunks yield live instead of waiting for segment end. Vosk
    path unchanged (still batch).
  • Gates the streaming trigger on state != IDLE so OWW false-positives during
    between-segment silence don't start a phantom stream.

Testing

  • Added 6 unit tests covering pre/post-detection flush, live streaming, segment-end
    sentinel, mid-stream pause, mid-stream mic-end, and Vosk regression
  • All 95 tests pass, lint clean

Approvals
1 approval needed.

@oliviamiller oliviamiller requested a review from seanavery May 26, 2026 20:03
):
yield chunk
if oww_streaming:
# Already streamed — just emit segment-end sentinel
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 to yield the last chunk here before inserting the empty marker?

Just making sure we are not dropping data here. Maybe chunks counter check in the tests to verify?


# OWW just fired this frame — flush buffered chunks and switch to streaming.
# Gate on state to ignore OWW false-positives during silence between segments.
if (
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Could OWW fire while state=IDLE? If so, the next frame's was_detected is already True and streaming never starts

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