Overview
WakeCheckFilter monitors TranscriptionFrames 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[str]
required
List of wake phrases to detect in transcriptions
float
default:"3"
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:TranscriptionFrameobjects 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
States
WakeState
Default state - only non-transcription frames pass through
WakeState
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