breezy-keyboard-19095
11/01/2025, 6:19 AMlively-winter-88668
11/03/2025, 10:51 AMstt_node
You can override the stt_node method in your agent to customize how audio is processed before being sent to the STT model. Instead of using the default implementation that wraps non-streaming STT with StreamAdapter, you can buffer the entire audio until user_commit and then process it all at once.
Here's the approach:
1. Buffer audio frames during the user's turn instead of processing them incrementally
2. Wait for the user turn to be committed (which happens after VAD detects end of speech and the endpointing delay passes)
3. Process the entire buffered audio with your STT model in one batch
You would need to:
• Override stt_node to accumulate audio frames
• Listen for the turn completion signal (you can use on_user_turn_completed callback )
• Call the STT's recognize() method (for batch processing) instead of using stream()
There is an example of overriding the stt node at https://github.com/livekit-examples/python-agents-examples/blob/main/basics/interrupts_user.py (but for a different use case)