> ## 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

> Choose a speech-to-text provider and configure how your persona detects speech, handles silence, and manages turn-taking.

Choose how Anam transcribes user speech and configure how eagerly your persona responds via `voiceDetectionOptions` in the persona config.

```javascript theme={"system"}
const personaConfig = {
  name: "Cara",
  avatarId: "071b0286-4cce-4808-bee2-e642f1062de3",
  avatarModel: "cara-4",
  voiceId: "de23e340-1416-4dd8-977d-065a7ca11697",
  llmId: "a7cf662c-2ace-4de1-a21e-ef0fbf144bb7",
  systemPrompt: "You are Cara, a helpful customer service representative.",
  languageCode: "en",
  voiceDetectionOptions: {
    sttProvider: "deepgram",
    endOfSpeechSensitivity: 0.5,
    silenceBeforeSkipTurnSeconds: 5,
    silenceBeforeSessionEndSeconds: 3,
    silenceBeforeAutoEndTurnSeconds: 5,
    speechEnhancementLevel: 0.8,
  },
};
```

## Choose a speech-to-text provider

In the Anam Lab, open your persona's **Advanced** settings and choose an **STT Provider** under **Voice Detection**. You can also set `voiceDetectionOptions.sttProvider` when you create or update a persona, or in an ephemeral `personaConfig` when requesting a session token.

| Value | Behavior |
| - | - |
| Unset | Uses the platform default provider. In the Lab, select **Default**. Do not rely on this resolving to a particular provider. |
| `anam` | Uses Anam's speech-to-text provider. It supports every language available in the [transcription language selector](https://anam.ai/docs/personas/voices/multilingual.md#supported-languages). |
| `deepgram` | Uses Deepgram. Supported `languageCode` values are `en`, `es`, `fr`, `de`, `hi`, `ru`, `pt`, `ja`, `it`, and `nl`. |
| `cartesia_ink_2` | Uses Cartesia Ink-2. Supports English only (`languageCode: "en"`). In the Lab, select **Cartesia Ink-2**. |

### Cartesia Ink-2

To use Cartesia Ink-2 in the Lab, set your persona's transcription language to **English**, then select **Cartesia Ink-2** under **Advanced > Voice Detection > STT Provider**. For API requests, set `languageCode: "en"` and `voiceDetectionOptions.sttProvider: "cartesia_ink_2"`. The provider value is `cartesia_ink_2`, not `ink-2`.

### Language compatibility

The STT provider and transcription language must be compatible:

* If you choose an explicit unsupported `languageCode`, the Lab disables the combination and the API rejects it.
* If `languageCode` is omitted, empty, `null`, or `inherit`, the persona uses your organization's default transcription language.
* The Lab evaluates **Inherit from org default** against the current organization default and marks incompatible provider or language options as unavailable.

> [!WARNING]
>
> Set an explicit `languageCode` when you need to guarantee a specific STT provider. If your organization default changes to a language that the saved provider does not support, Anam ignores that provider selection for inherited-language sessions and uses the platform default provider instead. The session still starts, and the saved persona configuration is not changed.

To resolve an inherited-language mismatch, choose a supported language explicitly, select another provider, or contact [Anam support](mailto:support@anam.ai) to change your organization default. See [Multilingual Support](https://anam.ai/docs/personas/voices/multilingual.md) for language configuration details.

> [!NOTE]
>
> `sttProvider` applies only to full-pipeline sessions and is selected when the session starts. It is not supported with audio passthrough or avatar-only transports, which do not run Anam speech-to-text, and it cannot be switched with a mid-session voice detection update.

## Options

| Option | Range | Default | Description |
| - | - | - | - |
| `sttProvider` | `anam`, `deepgram`, or `cartesia_ink_2` | Unset (platform default) | Speech-to-text provider used to transcribe the user's speech. |
| `endOfSpeechSensitivity` | 0 – 1 | Provider-dependent | 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. |

When you omit `endOfSpeechSensitivity`, the default is `0.5` for `anam` and `deepgram`, and `0.67` for `cartesia_ink_2`.

> [!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.

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


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.