# Speech Synthesis

### 1. Speech to Speech

{% hint style="info" %}
Use Case: Live translation, transcription, Intepreter, Dictation.&#x20;

Example:  Can receive speech in any of the supported languages and respond with the translation speech in other supported languages.
{% endhint %}

<mark style="color:yellow;">`POST`</mark>  `/speech`

Headers

|              |                  |
| ------------ | ---------------- |
| Content-Type | application/Json |
| apikey       | string           |
| secret       | string           |

Body

| Name         | Type                           | Description                                                                    |
| ------------ | ------------------------------ | ------------------------------------------------------------------------------ |
| speech       | {filedatabase64} or {file url} | must be .ogg, .mp3, .wav                                                       |
| inlanguage   | string                         |                                                                                |
| outlanguage  | string                         |                                                                                |
| responsetype | string                         | Can be voice, image, video or text. If you need voice and text use voice,text. |
| stream       | boolean                        |                                                                                |

{% tabs %}
{% tab title="Request" %}

```json
{
    "speech":{filedatabase64} or {file url}, 
    "inlanguage":"hausa",
    "outputlanguage":"english",
    "responsetype":"voice", 
    "stream":false
}
```

{% endtab %}

{% tab title="Response" %}

<pre class="language-json"><code class="lang-json"><strong>
</strong>{
    "status":"success",
    "content":{filedatabase64} or {file url}, //.ogg, .mp3, .wav
    "inlanguage":"hausa",
    "outputlanguage":"english",
    "responsetype":"voice", //Can be voice, image, video or text. If you need voice and text use voice,text.
    "stream":false
}
</code></pre>

{% endtab %}
{% endtabs %}

***

### 2. Speech to Text

{% hint style="info" %}
Use Case: Dictation.\
Example: Get the written transcription of speech in a language, translate it to other languages and much more.
{% endhint %}

| Name         | Value            |
| ------------ | ---------------- |
| Content-Type | application/json |
| apiKey       | string           |
| secret       | string           |

#### Body

| Name           | Type                           | Description                                                                    |
| -------------- | ------------------------------ | ------------------------------------------------------------------------------ |
| speech         | {filedatabase64} or {file url} | must be .ogg, .mp3, .wav                                                       |
| inlanguage     | string                         |                                                                                |
| outputlanguage | string                         |                                                                                |
| responsetype   | string                         | Can be voice, image, video or text. If you need voice and text use voice,text. |
| stream         | boolean                        |                                                                                |

{% tabs %}
{% tab title="Request" %}

```
{
    "speech":{filedatabase64} or {file url}, //must be .ogg, .mp3, .wav
    "inlanguage":"yoruba",
    "outputlanguage":"igbo",
    "responsetype":"text", //Can be voice, image, video or text. If you need voice and text use voice,text
    "stream":false
}

```

{% endtab %}

{% tab title="Response" %}

{% endtab %}
{% endtabs %}
