Learn how to control when user speech is processed in your conversational bot
In conversational applications, there are moments when you don’t want to process user speech, such as during bot introductions or while executing function calls. Pipecat’s STTMuteFilter
lets you selectively “mute” user input based on different conversation states.
Common scenarios for muting user input include:
The STTMuteFilter
works by blocking specific user-related frames from flowing through your pipeline. When muted, it filters:
This prevents the Speech-to-Text service from receiving and processing the user’s speech during muted periods.
The filter must be placed between your Transport and STT service in the pipeline to work correctly.
The STTMuteFilter
supports several strategies for determining when to mute user input:
Mute only during the bot’s first speech utterance. Useful for introductions when you want the bot to complete its greeting before the user can speak.
Start muted and remain muted until the first bot utterance completes. Ensures the bot’s initial instructions are fully delivered.
Mute during function calls. Prevents users from speaking while the bot is processing external data requests.
Mute whenever the bot is speaking. Creates a strict turn-taking conversation pattern.
Use custom logic via callback to determine when to mute. Provides maximum flexibility for complex muting rules.
The FIRST_SPEECH
and MUTE_UNTIL_FIRST_BOT_COMPLETE
strategies should not
be used together as they handle the first bot speech differently.
First, create a configuration for the STTMuteFilter
:
Place the filter between your transport input and STT service:
STTMuteFilter
between transport input and STTExplore a complete working example that demonstrates how to use STTMuteFilter to control user input during bot speech and function calls.
Read the complete API reference documentation for advanced configuration options and muting strategies.
Experiment with different muting strategies to find the right balance for your application. For advanced scenarios, try implementing custom muting logic based on specific conversation states or content.
Learn how to control when user speech is processed in your conversational bot
In conversational applications, there are moments when you don’t want to process user speech, such as during bot introductions or while executing function calls. Pipecat’s STTMuteFilter
lets you selectively “mute” user input based on different conversation states.
Common scenarios for muting user input include:
The STTMuteFilter
works by blocking specific user-related frames from flowing through your pipeline. When muted, it filters:
This prevents the Speech-to-Text service from receiving and processing the user’s speech during muted periods.
The filter must be placed between your Transport and STT service in the pipeline to work correctly.
The STTMuteFilter
supports several strategies for determining when to mute user input:
Mute only during the bot’s first speech utterance. Useful for introductions when you want the bot to complete its greeting before the user can speak.
Start muted and remain muted until the first bot utterance completes. Ensures the bot’s initial instructions are fully delivered.
Mute during function calls. Prevents users from speaking while the bot is processing external data requests.
Mute whenever the bot is speaking. Creates a strict turn-taking conversation pattern.
Use custom logic via callback to determine when to mute. Provides maximum flexibility for complex muting rules.
The FIRST_SPEECH
and MUTE_UNTIL_FIRST_BOT_COMPLETE
strategies should not
be used together as they handle the first bot speech differently.
First, create a configuration for the STTMuteFilter
:
Place the filter between your transport input and STT service:
STTMuteFilter
between transport input and STTExplore a complete working example that demonstrates how to use STTMuteFilter to control user input during bot speech and function calls.
Read the complete API reference documentation for advanced configuration options and muting strategies.
Experiment with different muting strategies to find the right balance for your application. For advanced scenarios, try implementing custom muting logic based on specific conversation states or content.