> This page is for Audio Decisions.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://dev.hume.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://dev.hume.ai/_mcp/server.

# LiveKit

**This page shows you how to write a small plugin that adds Hume Audio Decisions to a LiveKit agent, so the LLM can reply to how the caller sounded.** Your plugin copies the caller's audio, cuts a clip when the caller stops speaking, sends the clip to Hume Audio Decisions, and adds the answers to the caller's turn before the LLM replies. The plugin takes the same inline approach as Pipecat's `PerceptionReader`, described in [Choose whether the reply waits](/audio-decisions/docs/realtime#choose-whether-the-reply-waits).

> **Info**
>
> **Official LiveKit support is coming soon.**

## What the plugin does

<table>
  <thead>
    <tr>
      <th>
        Step
      </th>

      <th>
        In a LiveKit agent
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        Copy the caller's audio
      </td>

      <td>
        Read the caller's audio track alongside the agent's own input, and keep a rolling buffer of it. Leave the frames the agent receives unchanged, so speech-to-text gets them without delay.
      </td>
    </tr>

    <tr>
      <td>
        Cut a clip
      </td>

      <td>
        When VAD reports the end of speech, take the latest speech from the buffer, extended to 5 seconds with earlier speech from the same turn, as 16 kHz, 16-bit mono WAV. See 

        [Choose which audio to send](/audio-decisions/docs/realtime#choose-which-audio-to-send)

        .
      </td>
    </tr>

    <tr>
      <td>
        Send the request
      </td>

      <td>
        From a background task, with one client reused for every clip and a 

        [wait limit](/audio-decisions/docs/realtime#set-the-wait-limit-in-code)

         of about 2 seconds after the caller stops.
      </td>
    </tr>

    <tr>
      <td>
        Add the answers to the turn
      </td>

      <td>
        In the agent's 

        `on_user_turn_completed`

         hook, wait for the answer up to the wait limit, then put the answer at the head of the caller's message, such as 

        `[frustrated 0.82]`

        . If the limit passes, reply without the answer.
      </td>
    </tr>

    <tr>
      <td>
        Choose questions
      </td>

      <td>
        Start with one question, such as "Does the caller sound frustrated?", and explain the answer line in the system prompt. See 

        [Choose questions](/audio-decisions/docs/realtime#choose-questions)

        .
      </td>
    </tr>
  </tbody>
</table>

## Build it

#### [Checklist for other frameworks](/audio-decisions/docs/realtime#checklist-for-other-frameworks)

Every step the plugin needs, from copying audio to keeping late answers. A full LiveKit cookbook is coming soon.

## Next steps

#### [Realtime decisions](/audio-decisions/docs/realtime)

Choose which audio to send, when to send it, and whether the reply waits.

#### [Pipecat](/audio-decisions/docs/integrations/pipecat)

See the same approach in a framework with built-in support.