> For the complete documentation index, see [llms.txt](https://docs.gmetri.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gmetri.com/metaverse/build/elements/texttospeech.md).

# Text to Speech

## Can I convert my text to audio?

You can add a TTS (Text To Speech) element to create audio from a given text.

### Step 1: Add a Text to Speech element

You can add 'Text-to-speech' element into your element from the top bar of your deployment.

<figure><img src="https://2186043722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mgll1jjQMRTVj7p6n7g%2Fuploads%2Fxh0LtuaKHEMMtf1Gh5zF%2Fimage.png?alt=media&amp;token=77439334-b16b-4fab-883a-5e70f0a56f35" alt=""><figcaption><p>Adding a text-to-speech element</p></figcaption></figure>

### Step 2: Adjust the Text to Speech element

You can enter the text you want in the Properties Panel, and click on "**Generate Speech Audio**" to convert it to speech. You can **preview** the audio after generating it, by clicking on the Preview link.

<figure><img src="https://2186043722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mgll1jjQMRTVj7p6n7g%2Fuploads%2FwKc75cK4SkXDg5qAabFE%2Fimage.png?alt=media&amp;token=df609bda-a020-4f98-8782-49523634fb72" alt=""><figcaption><p>Right panel - Text to Speech</p></figcaption></figure>

You can control the Pitch, Speed, Voice and the speaker's language.

{% hint style="info" %}
You need to "**Generate Speech Audio**" again after any changes in the text or its settings.
{% endhint %}

<figure><img src="https://2186043722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mgll1jjQMRTVj7p6n7g%2Fuploads%2FV0zo8BuJhjCdWBDwMKZm%2Fimage.png?alt=media&amp;token=6aab38e1-e53b-4675-af5f-c32e4ee4e0a8" alt=""><figcaption><p>Text to speech - Audio language</p></figcaption></figure>

<figure><img src="https://2186043722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mgll1jjQMRTVj7p6n7g%2Fuploads%2FfgnDSXK6lTJcIEDhUpAT%2Fimage.png?alt=media&amp;token=b4938b8a-1eba-4eab-aa8e-dce5475aeafe" alt=""><figcaption><p>Text to Speech - Audio voice</p></figcaption></figure>

The '**Convert to Audio'** feature allows you to save the converted text as an audio file. This can be useful if you want to swap the generated audio file with any other MP3 on your computer or the file manager - without having to rewire any rules you may have added.

<figure><img src="https://2186043722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mgll1jjQMRTVj7p6n7g%2Fuploads%2FdUEjOfCND79KIncsLOgu%2Fimage.png?alt=media&amp;token=afc3f644-f47d-40c5-a796-564870587575" alt=""><figcaption><p>Text to speech - Convert to audio element</p></figcaption></figure>

#### Replacing file after converting to audio element

In case you decide to 'Convert to audio element', you will be given the choice to swap the audio with a different one sourced either from your computer or the file manager.

By clicking on the name of the file, you will be taken directly to the file manager.

Read below to know how to select a file to upload an image/ video.

{% content-ref url="/pages/89Dj2jFYZ5UbZ0t6i2fd" %}
[Selecting a file](/metaverse/build/editor/file-manager/3rd-person-scenes.md)
{% endcontent-ref %}

<figure><img src="https://2186043722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mgll1jjQMRTVj7p6n7g%2Fuploads%2FEKizTITk0Ktf3weA5mdk%2Fimage.png?alt=media&amp;token=5caa352d-6c6b-4480-96c6-130f8a52f2b4" alt=""><figcaption><p>Upload/ Choose file</p></figcaption></figure>

## Example Experience

Here is an example experience and the rules applied on it

{% embed url="<https://rnghud.gmetri.com/text_to_speech>" %}
Example experience - Text to Speech
{% endembed %}

You have the option to set rules for when the audio should be played.

<figure><img src="https://2186043722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mgll1jjQMRTVj7p6n7g%2Fuploads%2FtnTbmlKCnN7ciNZLoOwv%2Fimage.png?alt=media&amp;token=bd063a64-6104-4bbd-bda1-3a0c879c1368" alt=""><figcaption><p>Rules - Text to speech</p></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.gmetri.com/metaverse/build/elements/texttospeech.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
