SttMuteFilter
Speech-to-text (STT) muting control module.
This module provides functionality to control STT muting based on different strategies, such as during function calls, bot speech, or custom conditions. It helps manage when the STT service should be active or inactive during a conversation.
- class pipecat.processors.filters.stt_mute_filter.STTMuteStrategy(*values)[source]
Bases:
Enum
Strategies determining when STT should be muted.
- FIRST_SPEECH
Mute only during first detected bot speech
- MUTE_UNTIL_FIRST_BOT_COMPLETE
Start muted and remain muted until first bot speech completes
- FUNCTION_CALL
Mute during function calls
- ALWAYS
Mute during all bot speech
- CUSTOM
Allow custom logic via callback
- FIRST_SPEECH = 'first_speech'
- MUTE_UNTIL_FIRST_BOT_COMPLETE = 'mute_until_first_bot_complete'
- FUNCTION_CALL = 'function_call'
- ALWAYS = 'always'
- CUSTOM = 'custom'
- class pipecat.processors.filters.stt_mute_filter.STTMuteConfig(strategies, should_mute_callback=None)[source]
Bases:
object
Configuration for STT muting behavior.
- Parameters:
strategies (set[STTMuteStrategy]) – Set of muting strategies to apply
should_mute_callback (Callable[[STTMuteFilter], Awaitable[bool]] | None) – Optional callback for custom muting logic. Only required when using STTMuteStrategy.CUSTOM
Note
MUTE_UNTIL_FIRST_BOT_COMPLETE and FIRST_SPEECH strategies should not be used together as they handle the first bot speech differently.
- strategies: set[STTMuteStrategy]
- should_mute_callback: Callable[[STTMuteFilter], Awaitable[bool]] | None = None
- class pipecat.processors.filters.stt_mute_filter.STTMuteFilter(*, config, **kwargs)[source]
Bases:
FrameProcessor
A processor that handles STT muting and interruption control.
This processor combines STT muting and interruption control as a coordinated feature. When STT is muted, interruptions are automatically disabled.
- Parameters:
config (STTMuteConfig) – Configuration specifying muting strategies
stt_service – STT service instance (deprecated, will be removed in future version)
**kwargs – Additional arguments passed to parent class
- property is_muted: bool
Returns whether STT is currently muted.
- async process_frame(frame, direction)[source]
Processes incoming frames and manages muting state.
- Parameters:
frame (Frame)
direction (FrameDirection)