From a flutter frontend, what is the easiest way t...
# ask-ai
f
From a flutter frontend, what is the easiest way to understand if the ai agent is speaking?
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.
If you want to check whether the AI agent is speaking from a Flutter frontend, you can keep an eye on the agent's state using the participant attributes. The state is available as
lk.agent.state
, and it can be things like
initializing
,
listening
,
thinking
, or
speaking
. When you see
speaking
, it means the agent is currently replying. Here’s a quick example:
Copy code
String agentState = participant.attributes['lk.agent.state'];
if (agentState == 'speaking') {
  // Agent is currently speaking
}
Sources: AI voice agents | LiveKit Docs