> ## Documentation Index
> Fetch the complete documentation index at: https://anam.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Voice Detection

> Configure how your persona detects speech, handles silence, and manages turn-taking

Configure how eagerly your persona responds to the user and how it handles silence via `voiceDetectionOptions` in the persona config.

```javascript theme={"system"}
const personaConfig = {
  name: "Cara",
  avatarId: "30fa96d0-26c4-4e55-94a0-517025942e18",
  avatarModel: "cara-4",
  voiceId: "6bfbe25a-979d-40f3-a92b-5394170af54b",
  llmId: "a7cf662c-2ace-4de1-a21e-ef0fbf144bb7",
  systemPrompt: "You are Cara, a helpful customer service representative.",
  voiceDetectionOptions: {
    endOfSpeechSensitivity: 0.5,
    silenceBeforeSkipTurnSeconds: 5,
    silenceBeforeSessionEndSeconds: 3,
    silenceBeforeAutoEndTurnSeconds: 5,
    speechEnhancementLevel: 0.8
  }
};
```

## Options

| Option                            | Range            | Default      | Description                                                                                                                                                           |
| --------------------------------- | ---------------- | ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `endOfSpeechSensitivity`          | 0 – 1            | `0.5`        | How eager the persona is to start speaking. 0 = waits until confident the user is done. 1 = responds earlier.                                                         |
| `silenceBeforeSkipTurnSeconds`    | 0 – 900 seconds  | `15` seconds | How long the user can be silent before their turn is skipped and the persona prompts them. Set to `0` to disable turn skip so the persona never prompts a quiet user. |
| `silenceBeforeSessionEndSeconds`  | 0 – 7200 seconds | `60` seconds | How long the user can be silent before the session ends automatically. Set to `0` to disable automatic session end.                                                   |
| `silenceBeforeAutoEndTurnSeconds` | 0.5 – 10 seconds | `5` seconds  | If the user starts speaking then stops, how long to wait before treating the turn as complete.                                                                        |
| `speechEnhancementLevel`          | 0 – 1            | `0.8`        | Level of noise reduction and voice enhancement applied to input audio. Higher values improve transcription accuracy in noisy environments.                            |

<Note>
  Setting `silenceBeforeSkipTurnSeconds` to `0` disables turn skip — the persona will not prompt a quiet user. Setting `silenceBeforeSessionEndSeconds` to `0` disables automatic session end on silence.
</Note>

These settings can be set when creating or updating a persona. See the [API Reference](/api-reference/personas/create-persona) for details.
