WakeCheckFilter
Processor that passes frames only after detecting wake phrases in transcriptions
Overview
WakeCheckFilter
monitors TranscriptionFrame
s for specified wake phrases and only allows frames to pass through after a wake phrase has been detected. It includes a keepalive timeout to maintain the awake state for a period after detection, allowing continuous conversation without requiring repeated wake phrases.
Constructor Parameters
List of wake phrases to detect in transcriptions
Number of seconds to remain in the awake state after each transcription
Functionality
The filter maintains state for each participant and processes frames as follows:
TranscriptionFrame
objects are checked for wake phrases- If a wake phrase is detected, the filter enters the “AWAKE” state
- While in the “AWAKE” state, all transcription frames pass through
- After no activity for the keepalive timeout period, the filter returns to “IDLE”
- All non-transcription frames pass through normally
Wake phrases are detected using regular expressions that match whole words with flexible spacing, making detection resilient to minor transcription variations.
States
Default state - only non-transcription frames pass through
Active state after wake phrase detection - all frames pass through
Output Frames
- All non-transcription frames pass through unchanged
- After wake phrase detection, transcription frames pass through
- When awake, transcription frames reset the keepalive timer
Usage Example
Frame Flow
Notes
- Maintains separate state for each participant ID
- Uses regex pattern matching for resilient wake phrase detection
- Accumulates transcription text to detect phrases across multiple frames
- Trims accumulated text when wake phrase is detected
- Supports multiple wake phrases
- Passes all non-transcription frames through unchanged
- Error handling produces ErrorFrames for robust operation
- Case-insensitive matching for natural language use