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

# Voice Formatting

> Format agent output for natural-sounding speech in Oration AI

## Overview

Voice formatting automatically transforms raw text from your language model into a format that sounds natural when spoken by text-to-speech technology. This feature helps your agents communicate more effectively by converting technical text into conversational speech patterns.

Voice formatting enables your agents to naturally speak:

* Numbers and currency (e.g., `$42.50` → "forty two dollars and fifty cents")
* Phone numbers (e.g., `+1234567890` → "plus one two three four five six seven eight nine zero")
* Dates, times, and percentages in conversational format. (Currenly this is limited to dates in the format `dd/mm/yyyy` or `dd-mm-yyyy` or `yyyy-mm-dd` or `yyyy/mm/dd`) (e.g., `10/05/2023` → "May 10th, 2023")

By default, voice formatting is **disabled** for new agents. You can enable it in the agent settings to improve the naturalness of your agent's speech.

These work for all languages supported by Oration AI.

***

## How Voice Formatting Works

When enabled, voice formatting processes your agent's text output through a series of transformations. Each transformation targets specific patterns to make speech sound more natural and conversational.

### Formatting Transformations

The formatting system applies these transformations in order:

| **Step** | **Function**              | **Description**                                     | **Before**                                  | **After**                                              |
| -------- | ------------------------- | --------------------------------------------------- | ------------------------------------------- | ------------------------------------------------------ |
| 1        | Format currency           | Converts dollar amounts to spoken words             | \$42.50                                     | forty two dollars and fifty cents                      |
| 2        | Format emails             | Replaces `@` with "at" and `.` with "dot"           | [john@example.com](mailto:john@example.com) | john at example dot com                                |
| 3        | Format dates              | Converts dates into spoken format                   | 10-05-2023                                  | May tenth, two thousand twenty three                   |
| 4        | Format times              | Time expressions                                    | 2:00 PM                                     | two PM                                                 |
| 5        | Format distances          | Converts distance measurements                      | 5km                                         | 5 kilometers                                           |
| 6        | Format units              | Converts measurement units                          | 100g                                        | 100 grams                                              |
| 7        | Format percentages        | Converts percentage symbols                         | 50%                                         | 50 percent                                             |
| 8        | Format phone numbers      | Spaces out digits for clarity                       | +1234567890                                 | plus one two three four five six seven eight nine zero |
| 9        | Remove markdown           | Removes markdown symbols like `_`, `` ` ``, and `~` | `**Bold** and *italic*`                     | Bold and italic                                        |
| 10       | Format new lines          | Converts line breaks to periods for smoother speech | Hello world`\n`to say                       | Hello world . to say                                   |
| 11       | Format colons             | Replaces `:` with `.` for better phrasing           | price: \$42.50                              | price. forty two dollars and fifty cents               |
| 12       | Handle special characters | Speaks special characters like `/` and `_`          | 5/207                                       | five slash two hundred and seven                       |
| 13       | Format numbers            | Handles general numbers appropriately               | -9, 2.5, 2023                               | minus nine, two point five, two thousand twenty three  |

***

## Enabling Voice Formatting

Voice formatting is controlled through your agent settings:

### In Agent Settings

1. Navigate to your **Agent Settings**
2. Go to the **Advanced Settings** tab
3. Find the **Voice Formatting** toggle
4. Enable the feature to activate natural speech formatting

When enabled, all text output from your agent will be processed through the formatting system before being converted to speech.

***

## When to Use Voice Formatting

**Enable voice formatting when:**

* Your agent handles customer service calls
* You need natural-sounding currency and number pronunciation
* Your agent reads addresses, phone numbers, or dates
* Professional, conversational tone is important

**Consider keeping it disabled when:**

* Your agent primarily handles technical support requiring precise terminology
* You need exact control over pronunciation
* Your use case involves specialized vocabulary that formatting might alter

***

## Best Practices

### Content Writing

* Write naturally in your prompts—let formatting handle the technical conversion
* Use standard formats for dates, currency, and numbers.
  * Dates should be in the format `dd/mm/yyyy` or `dd-mm-yyyy` or `yyyy-mm-dd` or `yyyy/mm/dd`
  * Currency should be in the format `$100` or `100 USD`
  * Numbers should be in the format `100` or `100.00`
  * Phone numbers should be in the format `+1234567890`
  * Percentages should be in the format `50%`
  * Distances should be in the format `5km`
  * Units should be in the format `100g`
  * Emails should be in the format `john@example.com`
* Test your agent's speech output after enabling formatting
* Do not mention any specific formatting for numbers, dates, currency, phone numbers, percentages, distances, units, emails, etc. in your agent's prompts as it may clash with the voice formatting system.
* In case some numbers are not being formatted correctly, you can use `--` to separate the numbers into groups of digits you want to be formatted. For example: Pin code is `123456` can be written as `1--2--3--4--5--6` to make the Agent speak the numbers slowly.

### Testing

* Enable voice formatting in a test environment first
* Listen to how your agent pronounces different types of content
* Adjust your content strategy based on formatting results

***

## Summary

Voice formatting transforms your agent's text output into natural-sounding speech, making conversations more engaging and professional. While disabled by default, enabling this feature significantly improves the user experience for most voice applications.

The formatting system handles common patterns automatically, requiring no changes to your agent's prompts or knowledge base content. Simply enable the feature in your agent settings to start delivering more natural voice interactions.

***

> Need more help? Reach out to our team at [support@oration.ai](mailto:support@oration.ai)
