STTMuteFilter
Processor for controlling STT muting and interruption handling during bot speech and function calls
Overview
STTMuteFilter
is a general-purpose processor that combines STT muting and interruption control. When active, it prevents both transcription and interruptions during specified conditions (e.g., bot speech, function calls), providing a cleaner conversation flow.
The processor supports multiple simultaneous strategies for when to mute the STT service, making it flexible for different use cases.
Want to try it out? Check out the STTMuteFilter foundational demo
Constructor Parameters
The STT service to control
Configuration object that defines the muting strategies and optional custom logic
Configuration
The processor is configured using STTMuteConfig
, which determines when and how the STT service should be muted:
Set of muting strategies to apply
Optional callback for custom muting logic (required when strategy is CUSTOM
)
Muting Strategies
STTMuteConfig
accepts a set of these STTMuteStrategy
values:
Mute only during the bot’s first speech (typically during introduction)
Mute during LLM function calls (e.g., API requests, external service calls)
Mute during all bot speech
Use custom logic provided via callback to determine when to mute
Input Frames
Indicates bot has started speaking
Indicates bot has stopped speaking
Indicates a function call has started
Indicates a function call has completed
User interruption start event (suppressed when muted)
User interruption stop event (suppressed when muted)
Indicates user has started speaking (suppressed when muted)
Indicates user has stopped speaking (suppressed when muted)
Output Frames
Control frame to mute/unmute the STT service
All input frames are passed through except VAD-related frames (interruptions and user speaking events) when muted.
Usage Examples
Basic Usage (Mute During First Speech)
Always Mute During Bot Speech
Custom Muting Logic with Function Calls
Frame Flow
Notes
- Combines STT muting and interruption control into a single concept
- Muting prevents both transcription and interruptions
- Multiple strategies can be active simultaneously
- Custom strategy allows for complex muting logic
- Placed before STT service in pipeline
- Maintains conversation flow during bot speech and function calls
- Efficient state tracking for minimal overhead