Hello, I would like to ask if there is a way to al...
# agents
b
Hello, I would like to ask if there is a way to allow asynchronous stt model to receive the full audio file, then receive a full transcript response on user_commit? Im currently trying to work on an agent using gpt-4o-transcribe WITHOUT the realtime strategy for better accuracy. However since this model is not a streaming STT model, it requires setting a VAD with it (which I set it Silero VAD). The problem now is that since the chunks of audio processed for every "speech end", the final transcript's accuracy is bad. Is there a way to send the full audio data to process the stt at once?
l
Out of interest, I tried feeding the question in AI and it suggested this, it sounds sensible, but I haven't tried it: Solution: Override the
stt_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)