# 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="/files/TBkfqetMfyfh3KprDzgf" 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="/files/gPSI4YR4FPBbRtufsWVq" 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="/files/gsCRVfFN7DeYIqqBSlNz" alt=""><figcaption><p>Text to speech - Audio language</p></figcaption></figure>

<figure><img src="/files/Z7RszRhrvD3wRlp8aP89" 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="/files/BcVCQ6D3zQLnovGE7xFJ" 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="/files/GJrmGbYlXLnhhnRCwczE" 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="/files/t1PTkoznWvekFrBjzdoU" alt=""><figcaption><p>Rules - Text to speech</p></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

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

The question should be specific, self-contained, and written in natural language.
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.
