# Text to Speech

<figure><img src="https://4121582948-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKz66WcKqTPRwdFrHi4mM%2Fuploads%2FfCLMfOkvq0gK9cJ2rCg0%2Fimage.png?alt=media&#x26;token=a8b9c6ca-c04f-49d9-95eb-02cfd8dcd8e2" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
The TTS (Text-to-Speech) Extension is available starting from **VNTranslator Pro v1.0.0**, accessible for **Supporter+** tier and above.
{% endhint %}

***

### Enabling the TTS Extension

To enable the TTS Extension, follow these steps:

* Go to **Settings -> Extensions -> Text to Speech**
* Toggle the switch to **On**
* Relaunch the app

***

### Creating a New TTS List

* Open the **TTS Window**
* Click the **New List** button to create a new TTS list

***

### Adding Voices to a TTS List

* Click on the **TTS name** to open the **Voice Editor**
* Click the **Add Voice** button to add a new voice entry
* In the **Character Name** field, enter the character name associated with the voice
* In the **Text Source** field, select the input source for the TTS voice. You can choose between:
  * **Source Text** - Uses the original text as the TTS input
  * **Target Text (Translation)** - Uses the translated text as the TTS input

#### About Character Names

The character name is used to determine which voice will be played based on the text source. Below are the available options:

* **Default** or **None** - Defines the default voice that will be played when no matching character name is found in the source text or translation
* **"%" Pattern (Wildcard)**  - Use the `%` wildcard to define a dynamic name pattern. For example, if the source text contains `Anita: Hello World`, you can enter `Anita%` as the character name to match it
* **Multiple Character Names** - You can enter more than one character name by separating them with a comma (`,`). For example: `Ani%, Amelia%`

***

### Supported TTS Engines

VNTranslator supports the following TTS engines:

#### Online

<figure><img src="https://4121582948-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKz66WcKqTPRwdFrHi4mM%2Fuploads%2F6fgP0hGHsvqMtcmOnC7h%2Fvnt-tts-02.png?alt=media&#x26;token=c99ea384-9e6c-4512-8517-50e871f25e4a" alt=""><figcaption></figcaption></figure>

* ElevenLabs
  * <https://elevenlabs.io/app/developers>
* Google Cloud TTS
  * <https://docs.cloud.google.com/text-to-speech/docs>
* Speechify
  * <https://console.speechify.ai/>
* Inworld TTS
  * <https://platform.inworld.ai/>

#### Offline

<figure><img src="https://4121582948-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKz66WcKqTPRwdFrHi4mM%2Fuploads%2FMw3Ufg97i2P66astHNhs%2Fvnt-tts-01.png?alt=media&#x26;token=c06b0b46-54dd-44af-8be2-626942b52819" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**Note:** Offline TTS engines must be installed on your computer before use.
{% endhint %}

* [Pocket TTS (English Only)](https://docs.vntranslator.com/features/extensions/text-to-speech/pocket-tts)
* [Kokoro TTS](https://docs.vntranslator.com/features/extensions/text-to-speech/kokoro-tts)
* [VoiceVox (Japanese Only)](https://docs.vntranslator.com/features/extensions/text-to-speech/voicevox)
* ~~Piper TTS~~
* ~~Web Speech API (Browser)~~

***

### Custom Engine

* Endpoint
* ContentType
  * `application/json`
  * `multipart/form-data`
* Headers
* Body
* ResponseType
  * `Audio Format`
  * `Base64 Format`
* ResponseQuery
