quick-gpu-24854
10/20/2025, 9:26 AMtall-airline-16756
10/20/2025, 9:27 AMtall-airline-16756
10/20/2025, 9:28 AMuseAgent React hook for this. It offers some really useful properties and methods to manage audio session readiness:
• isAvailable: This tells you if the agent is ready to interact with users. It returns true when the agent is in states like 'listening', 'thinking', or 'speaking'.
• isBufferingSpeech: This helps you track the audio session bootstrapping by indicating if the audio preconnect buffer is active, meaning the agent hasn’t connected just yet.
• state: This gives you the current state of the agent, such as 'initializing', 'idle', 'listening', 'thinking', or 'speaking'.
Additionally, you can use the waitUntilAvailable(signal?: AbortSignal) method to patiently wait until the agent is ready for interaction.
This hook is thoughtfully designed to help with audio session readiness and managing the agent’s state in LiveKit React applications. If you have any questions or need further guidance, feel free to ask—I’m here to support you!
Sources: packages/react/src/context/session-context.ts