> For the complete documentation index, see [llms.txt](https://docs.borndigital.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.borndigital.ai/digital-agent/voice/voice-variables.md).

# Voice variables

Flow variables that change speech recognition, listening and transfers during a call, and the variables the voice channel fills in.

Most voice behaviour is set in the [Deploy dialog](https://docs.borndigital.ai/digital-agent/workspace/deploy-project.md#voice) and in the [Answer node](https://docs.borndigital.ai/digital-agent/voice/listening-and-timing.md). When it must change during a call – another language, a longer timeout for one question – set one of these variables in the flow, for example in the **Variables** of a Message or Answer node. The voice channel reads them with every reply of the flow, so a value set in a node applies when the agent listens after that node.

## Speech recognition

| Variable                         | Value                    | Effect                                                                              |
| -------------------------------- | ------------------------ | ----------------------------------------------------------------------------------- |
| `stt_language`                   | language code, e.g. `de` | The language of speech recognition. `auto` lets ElevenLabs detect it.               |
| `tts_language`                   | language code            | The language of speech synthesis.                                                   |
| `stt_provider`                   | provider name            | Switches the speech-to-text provider.                                               |
| `stt_detect_language`            | `true` / `false`         | Language detection – the same as **Language detection** in the Answer node.         |
| `stt_boost`                      | list of phrases          | Google: words and phrases to recognise more reliably.                               |
| `stt_prompt`                     | text                     | Whisper: a hint for the transcription, for example product names.                   |
| `stt_secondary_languages`        | list or comma-separated  | ElevenLabs: other languages the caller may speak.                                   |
| `stt_keyterms`                   | list                     | ElevenLabs: up to 50 key terms (max 20 characters each) to recognise more reliably. |
| `stt_entity_detection`           | list                     | ElevenLabs: detects entities in the speech; the result is in `stt_entities`.        |
| `stt_filter_background_audio`    | `true` / `false`         | ElevenLabs: suppresses background noise before recognition.                         |
| `stt_include_language_detection` | `true` / `false`         | ElevenLabs: returns the detected language in `detected_language_code`.              |

{% hint style="info" %}
The voice channel reads these variables even when the flow limits which variables the API may edit (**Api editable**). Secret variables are never sent.
{% endhint %}

## Pronunciation

| Variable            | Value                                            | Effect                                                                                                                          |
| ------------------- | ------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------- |
| `tts_pronunciation` | `{"<language>": [{"from": "...", "to": "..."}]}` | Replaces whole words just before speech synthesis, so names and phrases sound the same in every reply. `{}` turns it off again. |

Example – say *Kuwait Finance House* wherever a reply contains *KFH*:

```json
{"en": [{"from": "KFH", "to": "Kuwait Finance House"}]}
```

* The language is the speech synthesis language (`tts_language`). Words match whole and case-insensitively; the longest entry wins.
* Only the spoken audio changes – the chat text, subtitles and transcripts keep the original reply.
* Set it once, for example in the START node; it stays for the rest of the conversation.
* `from` up to 60 characters of plain text, `to` up to 400 characters, up to 200 entries per language.
* With an **Azure** voice, `to` may use the SSML tags `phoneme`, `sub`, `prosody` and `break` – for example `{"ar": [{"from": "KFH", "to": "<sub alias=\"K F H\">KFH</sub>"}]}` spells the abbreviation. Other voices (ElevenLabs and the rest) get only the text: the alias of `sub`, the content of the other tags, nothing for `break`. An entry with another tag, an unknown attribute or unclosed tags is skipped.
* Sentences that were already being spoken when the variable was set are not changed.
* Not available for realtime agents, which have no separate speech synthesis.

## Listening and timing

These are the variables behind the Answer node settings; the node sets them for its turn.

| Variable                                        | Unit    | Answer node setting                           |
| ----------------------------------------------- | ------- | --------------------------------------------- |
| `no_input_timeout`                              | s       | **No input timeout**                          |
| `too_long_input_timeout`                        | s       | **Max listening time**                        |
| `partial_stt_result_silent_time`                | ms      | **Transcription end after**                   |
| `azure_continue_transcription_after_recognized` | `true`  | **Continuous transcription**                  |
| `speech_silences_nlp_playback`                  | boolean | **Interrupt anytime**                         |
| `speech_interrupt_buffer_ms`                    | ms      | **Speech interrupt buffer**                   |
| `allow_dtmf_signals`                            | boolean | **Processing of DTMF signals**                |
| `dtmf_signals_length`                           | count   | **DTMF signals length**                       |
| `dtmf_timeout`                                  | ms      | **DTMF timeout** (set in seconds in the node) |
| `dtmf_silences_nlp_playback`                    | boolean | **DTMF signal silences agent**                |
| `chatbot_no_input_timeout`                      | s       | **No input timeout** on the Chatbot tab       |
| `chatbot_no_input_max_repeats`                  | count   | **Max. reminders** on the Chatbot tab         |

More variables have no setting in the node:

* `barge_in_partial_stt_result_silent_time` (ms) – after the caller interrupts the agent, keep listening until a pause of this length instead of ending at the first recognised phrase. `0` or empty keeps the default behaviour.
* `barge_in_type` – what happens when the caller speaks while the agent prepares its answer: `queue_while_thinking` (answered right after the reply) or `ignore_while_thinking` (ignored). Empty keeps the default. See [Interruptions](https://docs.borndigital.ai/digital-agent/voice/listening-and-timing.md#interruptions-barge-in).
* `azure_segmentation_silence_timeout_ms` (ms) – how long a pause ends a phrase in Azure speech-to-text. Set it higher, for example `1200`, when callers pause inside one question and it is split in two. Empty keeps the Azure default.

### Continue while a message is still playing

When a Message node has [**Execute message first**](https://docs.borndigital.ai/digital-agent/conversation-flow/nodes-explained/message-node.md#configuration) on, the flow waits until the message has been played before it moves to the next node. Set `message_played_type` on that turn to let the flow move on earlier:

| Value                      | Effect                                                                                                                                                                                                                                              |
| -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `after_playback` (default) | The flow continues after the message has finished playing.                                                                                                                                                                                          |
| `immediate`                | The flow continues as soon as the message starts playing, so a slow node after it – an API call, an LLM step – runs while the caller is still listening. The next reply is played only after the current message has finished, so nothing overlaps. |

Example: an 8 s "please hold on, I'm checking your contract" message followed by a 6 s backend call takes about 14 s with `after_playback` and about 8 s with `immediate`.

The variable applies only to turns where the agent does not listen for the caller – a message with **Execute message first**. On other turns it has no effect. An empty value means `after_playback`, and so does any other value than the two above.

## Transfers

* Variables whose name starts with `X_` are sent as SIP headers – `X_Customer_Id` as `X-Customer_Id` – when the call is transferred to a conference. Use them to pass data to the contact centre.

## Variables the voice channel fills in

| Variable                                                                                                     | Content                           |
| ------------------------------------------------------------------------------------------------------------ | --------------------------------- |
| `dtmf_signals`                                                                                               | The keys the caller pressed.      |
| `detected_language`, `detected_language_code`, `detected_language_confidence`, `detected_language_utterance` | The result of language detection. |
| `stt_entities`                                                                                               | Entities detected by ElevenLabs.  |
