> 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/for-advanced-users/conversation-design-tips/customizing-speech-synthesis/intonation-and-pauses.md).

# Intonation and pauses

Shape the melody of synthesized speech and set the length of pauses with punctuation and SSML.

Master the art of customizing speech synthesis intonation with SSML on our [dedicated documentation page](https://docs.borndigital.ai/for-advanced-users/conversation-design-tips/customizing-speech-synthesis.md#ssml-tags). Learn to personalize your AI voice with precision and creativity for a truly tailored and engaging auditory experience!

<details>

<summary>Here are some <strong>basic tips</strong></summary>

1. **Understand the context**: Intonation conveys meaning and emotion in speech. It's important to consider the context and intended message of the text. Identify the keywords, phrases, or sentences that require specific intonation patterns to convey the desired emphasis or emotion.
2. **Use punctuation**: Punctuation marks such as commas, periods, question marks, and exclamation marks indicate natural breaks and changes in intonation. Make sure to add appropriate punctuation to your text to guide the TTS system's intonation.
3. **Prosody tags**: Utilize SSML tags to explicitly specify the desired intonation patterns for specific words or phrases.
4. **Experiment with pitch and duration**: Intonation involves variations in pitch and duration. Adjusting the pitch can create rising or falling intonation patterns while manipulating the duration of syllables or phrases can add emphasis or rhythmic patterns. Experiment with these parameters to achieve the desired intonation.
5. **Listen and iterate**: After applying intonation modifications, listen to the generated speech and evaluate the effectiveness of the intonation patterns. Make adjustments as needed to achieve the desired expressive quality and convey the intended meaning.
6. **Consult native speakers**: If possible, seek feedback from native speakers of the target language to ensure that the intonation sounds natural and appropriate. Native speakers can provide valuable insights and guidance on the intonation patterns specific to the language and context.

</details>

{% hint style="info" %}
Remember that achieving natural and expressive intonation in TTS systems can be challenging, as it requires capturing the nuances of human speech. It may take some **experimentation and refinement** to achieve the **desired results.**
{% endhint %}

***

## Intonation curve

Text-to-speech synthesis is also able to **automatically detect the sentence type and set the corresponding intonation curve**. This means that you can easily create a synthesized voice that sounds natural and matches the text you enter accurately.

{% hint style="success" %}
**Pro-tip!** :sparkles: For neural voices provided by Microsoft Azure, feel free to use the [Audio content creator tool](https://speech.microsoft.com/audiocontentcreation) in Azure Speech Studio. Fine-tune synthesized speech audio to fit your scenario. Define lexicons and control speech parameters such as pronunciation, pitch, rate, pauses, and intonation
{% endhint %}

{% tabs %}
{% tab title="Video example" %}

<figure><img src="https://4261467870-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6iQTvxgRZRwPS1NgIGEb%2Fuploads%2FfiI6Q1OC8YaGBL2alByj%2Fimage.png?alt=media&amp;token=2a0f23fd-55fd-4b5d-927e-d13a0b59800f" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Azure intonation edit" %}

<figure><img src="https://4261467870-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6iQTvxgRZRwPS1NgIGEb%2Fuploads%2F9LYtN545cIcJCabeBLyT%2Fimage.png?alt=media&amp;token=a6eac3e6-2045-4bb8-917d-49250e77f23f" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Step by step guide" %}

* In the dialogue window, you can see the **width of each word segment**(x-axis) on the intonation curve.
* Keep in mind that **longer words contain more vowels** and therefore more opportunities for the intonation curve to be modified.
* By default, the intonation curve is represented by a straight line at 0%. However, this **does not mean** that the **basic intonation is completely flat!** The tool allows you to adjust the pitch **relative** to the automatic basic synthesis.
* A maximum of **five intonation points** can be plotted on the curve for a single section.
  {% endtab %}
  {% endtabs %}

In Azure Audio Content Creator, you can adjust intonation **in sections,** which means you can set intonation for each **sub-section, phrase, or word separately**, instead of having to set intonation for the whole sentence. This allows you to capture different intonation nuances more accurately and gives you more control over how the neural voice will appear.

**Accentuating intonation** allows listeners to distinguish between the different ideas and information contained in a sentence. By adjusting intonation curves, you can **highlight important points or emphasize changes in mood or emotion**, which will help the listener better understand and remember what the voice is saying.

<details>

<summary><mark style="color:green;"><strong>Intonation best practice tips</strong></mark></summary>

Here's how you can work with the Intonation curve effectively:

* **Understand the Intonation curve**: The Intonation curve represents the pitch contour of the speech waveform. It visualizes the changes in pitch over time. The x-axis represents time, and the y-axis represents pitch.
* **Identify key points:** Identify the key points in the text where you want to manipulate the intonation. These points could include emphasized words, important phrases, or sections that require specific intonation patterns.
* **Add anchor points:** Add anchor points on the Intonation curve to indicate the pitch changes. Click on the curve at specific time points to create anchor points. These points will serve as the reference for manipulating the pitch.
* **Adjust pitch and duration:** Drag the anchor points up or down to adjust the pitch at those time points. Moving them upward raises the pitch while moving them downward lowers the pitch. You can also drag the edges of the anchor points to modify the duration of the pitch change.
* **Create prosody patterns:** By adding multiple anchor points and adjusting their positions, you can create inflection patterns such as rising, falling, or fluctuating intonation. For example, a rising intonation pattern can indicate a question, while a falling intonation pattern can denote a statement or completion.
* **Preview and refine:** Preview the speech with the modified Intonation curve to evaluate the impact of your changes. Fine-tune the positions of anchor points as needed to achieve the desired intonation patterns.
* **Iterate and experiment:** Intonation patterns can be subjective and depend on the context and language. Experiment with different anchor point positions, shapes, and durations to find the most appropriate intonation for your specific text.

</details>

{% hint style="info" %}
When adjusting intonation curves, you should consider several factors such as sentence length, rhythm, accent, and the emphasis you want to convey. It is important to remember that intonation is a complex subject and that you need to practice and try different approaches.
{% endhint %}

***

## Melody patterns

Here are some examples of inflexion patterns you can achieve:

{% tabs %}
{% tab title="Rising intonation" %}
To create a rising intonation pattern, you would place anchor points at the beginning of a phrase or sentence and gradually raise the pitch as you move forward in time. This pattern is commonly associated with questions or uncertainty.
{% endtab %}

{% tab title="Falling intonation" %}
A falling intonation pattern involves placing anchor points at the beginning of a phrase or sentence and gradually lowering the pitch as you move forward in time. This pattern often signals a statement or completion.
{% endtab %}

{% tab title="Fluctuating intonation" %}
You can create a fluctuating intonation pattern by adding anchor points at various positions along the Intonation curve. This pattern involves both rising and falling pitch movements, conveying emphasis or highlighting important information.
{% endtab %}

{% tab title="Plateau intonation" %}
A plateau intonation pattern maintains a relatively steady pitch without significant changes. You would position anchor points at similar heights along the curve, resulting in a flat or level pitch. This pattern is often used for conveying neutral or declarative statements.
{% endtab %}
{% endtabs %}

**Want more detailed tips** :interrobang:

<details>

<summary><span data-gb-custom-inline data-tag="emoji" data-code="1f1e8-1f1ff">🇨🇿</span> CZ intonation patterns step-by-step</summary>

### Basic patterns in Czech language

**Rising intonation for questions**: In Czech, rising intonation is commonly used to indicate questions. When using the Intonation curve, create a rising pattern by gradually increasing the pitch from the beginning to the end of the question phrase or sentence. To emphasize the end of the question, you can drop the curve a little bit lower before you bring it up to its amplitude.\\

**Falling intonation for statements**: Statements in Czech typically have falling intonation. To convey this, place anchor points at the beginning of the statement and gradually lower the pitch as you move forward in time. This falling pattern gives a sense of finality and completion to the sentence.\\

**Distinctive pitch accents**: In Czech, pitch accents do not typically change the meaning of a word. Unlike some tonal languages where pitch variations can differentiate lexical meanings, Czech does not have a lexical tone. Instead, Czech is characterized by patterns of stress and intonation.\\

**Emphasizing keywords**: In Czech, emphasis is often placed on specific words to highlight their importance or to contrast them with other elements in the sentence. Use the Intonation curve to create a noticeable pitch increase on the emphasized word or phrase. This helps convey the intended emphasis and focus within the sentence.\\

**Pay attention to sentence structure**: The word order and sentence structure in Czech can influence intonation patterns. For example, the initial position of a subject in a sentence may receive more prominent intonation. Be mindful of these structural cues and adjust the intonation accordingly.

<br>

### Question intonation

If we want to improve intonation to make it clear that this is a question, the first instinct should be to set a curve rising with the end of the sentence.

There are also some specific words that **indicate a question,** such as **interrogative pronouns** (what, who, where, etc.). If we **raise the intonation** on the curve at this point, we will e**mphasize these words**. This can be useful if we want to elicit specific information from users. This will be more effective for multi-word questions. For very short questions, or questions made up of very short words, there are not enough vowels available to allow the melody of the more complex intonation curves to "sing" the melody correctly.

***Proč** máš tak veliké zuby?* - Emphasize we're looking *for reason.*

***Kolik** vlasů má pohádkový dědeček Vševěd?* - Emphasize we're looking *for count*.

***Jak** se podle vás správně budí princezny?* - Emphasize we're looking *mean of*.

\
This will be **more effective for longer questions.** For very short questions or questions made up of very short words, there are not enough vowels available to allow the more complex intonation curves to get the melody right.

*Jaká je adresa tvého trvalého bydliště?* ✓✓✓\
*Řekneš mi, kde bydlíš?* ✓✓\
*Kde domov můj?* ✓\
*Jak se máš?* ✓\
*Jak je?* ✗

\
Using SSML, you can also transform the original statement into a question. The melody of the sentence will probably appear "flatter" compared to a classically written question with a question mark at the end, which is rising by default.

**How to correct excessive pitch for Czech neural voices**

Sometimes the neural voice may seem to intone the ends of questions correctly but unnaturally. Typically, the end of a sentence suddenly shoots off significantly in intonation, the voice seems " textbook-ish", as if it mutates, sounds affected or strangled.

**If the pitch of synthetic speech seems to rise too much at the end of questions,** there are a few things you can try.

* [x] Check the text to synthesize, and if necessary, try adjusting the copywriting.

*Už máte sjednané nové pojištění?* → Prosím řekněte mi, zda již máte sjednané nové pojištění.

* [x] Consider adjusting the pitch of the synthesized sentence using the Pitch feature. This allows you to move the pitch of the synthesized speech up or down. In this case, adjust the index downwards by a few percent (e.g. 1 → 0.98).
* [x] Another option is to adjust the intonation curve and reduce the exaggerated pitch at the end of the sentence. Enter the intonation point a few per cent lower than the default value.

</details>

***

## Pauses and breaks best practice

### Basics

The **\<break>** tag is used to create a pause of a given length in the text. This tag can be used, for example, to express a pause between words or sentences, which can help to improve the naturalness of the delivery.

{% hint style="info" %}
Azure Audio content creator tool offers both predefined tags and the ability to incorporate breaks of a length of our choosing.
{% endhint %}

{% tabs %}
{% tab title="Break tag" %}
The **\<break> tag in SSML** is used to insert a pause or a break in the speech output. It allows you to specify the duration and the strength of the pause. The \<break> tag can be used with the following attributes:

*<mark style="color:purple;">time:</mark>*\
Specifies the duration of the pause in seconds or milliseconds. For example, \<break time="500ms"/> inserts a pause of 500 milliseconds.

*<mark style="color:purple;">strength:</mark>*\
Specifies the strength or intensity of the pause. It can have values like "none", "x-weak", "weak", "medium", "strong", or "x-strong". The actual interpretation of these values may depend on the specific text-to-speech engine used.

### Example

* Hello, <mark style="color:blue;">\<break</mark> <mark style="color:purple;">time="500ms"</mark><mark style="color:blue;">/></mark> how are you today?
* Hello, <mark style="color:blue;">\<break</mark> <mark style="color:purple;">strength="medium"</mark><mark style="color:blue;">/></mark> how are you today?
  {% endtab %}

{% tab title="Pause - sentences" %}
A normal punctuation dot is an interruption of approximately **200-300 ms.** If you find these pauses too long, we recommend replacing the punctuation with a shorter break. Ideally **100 ms, but never less than 50 ms.**

{% hint style="warning" %}
The punctuation must **be replaced** by SSML break! Putting a break tag after punctuation would paradoxically make the pauses even longer (default punctuation pause length 300 ms + additional break tag length).
{% endhint %}

By setting **different pause lengths,** we can influence the **rhythm of speech**. For example, set a shorter pause between sentences that form a single thought than at the front of different thoughts. Millisecond differences in pause length are almost imperceptible to the conscious human. However the different **impression of synthesis is mainly created by the change of rhythm between sections**. We can take advantage of this and better separate the individual information.

For example, a message can be divided into the sections *acknowledgement → argumentation → call to action → confirmation question*. The argumentation consists of several sentences that form one train of thought, so it gets shorter pauses; the **100 ms** gap between sections is **more distinctive**:

```
Thank you, I have your request.<break time="100ms"/>Your new card is on its way<break time="50ms"/>and it will arrive within five working days<break time="50ms"/>you can activate it in the app.<break time="100ms"/>Please keep your old card until then.<break time="100ms"/>Shall I send you a confirmation by e-mail?
```

{% endtab %}

{% tab title="Pause - words" %}
The **break also affects the intonation** of the sentence and acts as an intonation dot, i.e. the intonation curve drops at the end.

Sometimes, however, we need to edit a pause between words or parts of sentences without intonating a full stop after the sentence. A **softer drop** in voice and at the same time a pause are provided by other signs, the most prominent of which is the punctuation mark, and slightly more subtle are the **colon**, **semicolon** or **dash**.

> > **Prominent pauses:**\
> > Něco končí \<break strength="weak"/> Něco začíná.\
> > Něco končí \<break time="100ms"/> Něco začíná.\
> > Něco končí. Něco začíná.

> > **Softer pauses:**\
> > Něco končí; něco začíná.\
> > Něco končí, něco začíná\
> > Něco končí: něco začíná.\
> > Něco končí- něco začíná.

It is recommended that these marks be added at the point where the voice drop and short pause are to occur, or that they replace the original punctuation. If the pause is too short, write several of these signs in a row, adding their lengths together.

> > Něco končí,,, něco začíná.\
> > Něco končí;; něco začíná.

### Example

```
You can choose from two options;; option A<break time="100ms"/>we send the new card by post,, or option B<break time="100ms"/>you pick it up at a branch.
```

Note that we have applied **multiple strategies** to improve the quality of the synthesis in the example.

1. We have **rewritten** the graphical distinction of the options with words (**A. ---> option A**);
2. **Replacing punctuation** marks with a **break tag** of a chosen length;
3. **Combining additional punctuation marks** between words for finer and shorter pauses with less effect on intonation.
   {% endtab %}

{% tab title="Pauses - after question" %}
The **question mark** serves as a punctuation mark that not only indicates a question but **also functions as a pause.** When a question is posed, there is typically a brief interruption of a**round 300 milliseconds.**

However, if the question is followed by additional text, this pause can disrupt the flow of speech and give the impression that the voicebot has finished speaking. To prevent the voicebot and the user from overlapping in their speech, it is important to consider certain strategies for phrasing questions and placing them appropriately within the speech. The chapter on copywriting delves into these strategies in more detail.

Let's review some fundamental principles of good practice:

* **Each message** should contain only **one question.**
* **Each question** should focus on a **single topic**. For example, instead of asking, "Would you like to create a new account and join our Premium Club?" it is better to ask separate questions for each option.
* It is advisable to include the **question at the end of the message** so that the user has already received all the necessary information.
  {% endtab %}

{% tab title="A/ B question" %}
Let's address one specific case of choice questions (e.g., "Do you want A or do you want B?").

In this scenario, it is crucial to ensure good synthesis and **emphasize distinctive intonation to convey the question's intent clearly and elicit the expected response.** One recommendation is to structure the sentence in a way that presents each option as a separate sentence.

To assess the quality of synthesis, intonation, and the initial impression the question makes, **experiment with different writing styles and punctuation**. It is possible that breaks or punctuation marks may not provide a sufficiently distinct separation between the two options. In such cases, trying out a question mark after each option could be worth considering.

<br>

Please note that this is not a violation of the rule stating that only one question should be included in each text. It's important to **remember that speech synthesis input notation serves a different purpose** than regular text and does not necessarily adhere to grammar or spelling conventions. In this instance, it is considered a single question, with each option represented by a distinct intonation pattern that visually resembles a question mark.

In the case of *"Do you want coffee? Or do you want tea?"* a pause between the two options might **be excessively long**. Unfortunately, this gap cannot be shortened using the break tag. One possible approach is to remove the space after the first question mark *(e.g., "Do you want coffee?Or do you want tea?").* In certain cases, **combining the options into one continuous string can be helpful**, with the question mark indicating the intonation but without the unwanted extended pause.

However, **note** that this is just **one of the potential solutions and not the only correct way** to adjust the intonation in such cases.
{% endtab %}
{% endtabs %}

***
