While the agent is speaking, if i set session.outp...
# ask-ai
f
While the agent is speaking, if i set session.output.set_audio_enabled(false) it keeps speaking with the audio untile the next question and i stop receving the transcripts
t
Thanks for reaching out, muse. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I totally understand how important it is to get this right! When you use
session.output.set_audio_enabled(false)
during an agent's speech, the audio output stops immediately, and any speech that's happening will be interrupted. This also means the agent’s voice will pause mid-sentence, and any speech waiting in the queue will be cleared. While the audio is off, the agent can still send transcribed text responses through the
lk.transcription
text stream topic, as long as text output is enabled. Just a heads-up, these text responses won’t have the
lk.transcribed_track_id
attribute, so they won’t sync up with audio playback. If you'd like, I’m here to help you set up your client to smoothly handle text responses when the audio is disabled—just let me know! Sources: Text and transcriptions | LiveKit Docs | Text and transcriptions | LiveKit Docs | livekit-agents/livekit/agents/voice/chat_cli.py | How to Set Up Speech-to-Text Input with Text-Only Output in LiveKit Agents | Docs::Agents
f
My problem is that the audio does not stops immediatly... It stops only after he has finished talking and it will be muted only at the next answer
t
Thanks so much for reaching out! To help you better, could you please let me know if the delayed audio stop happens every time an agent responds, or just in certain situations? Also, are there any custom settings or integrations you’re using that might be influencing how the audio works? I’m here to help get this sorted for you!
f
It happens every time. I make an rpc call to the backend which only set: session.output.set_audio_enabled(not is_muted)
?