Skip to content

TTS Schemas

JobErrorResult

Example

1
2
3
{
  "error": "string"
}

Properties

Name Type Optional Description
error string false The error that occurred

JobStatus

The progress status of a job

Example

1
"complete"

Properties

Name Type Optional Description
JobStatus string true The progress status of a job
Enumerated Values
Property Value
JobStatus complete
JobStatus created
JobStatus queued
JobStatus in_progress
JobStatus failed
JobStatus cancelled

JobStatusResponse

Example

1
2
3
4
5
6
{
  "job_id": "2fec34e1efb146f7a7431cb35b64550d",
  "status": "complete",
  "created_at": "2019-08-24T14:15:22Z",
  "modified_at": "2019-08-24T14:15:22Z"
}

Properties

Name Type Optional Description
job_id string false The id associated with a job
status JobStatus false The progress status of a job
created_at string(date-time) false The time that the job was created at
modified_at string(date-time) false The time that the job was last modified at

PaginationInfo

Example

1
2
3
4
5
{
  "page": 0,
  "per_page": 0,
  "page_count": 0
}

Properties

Name Type Optional Description
page integer false -
per_page integer false -
page_count integer false -

SortableFieldTts

An enumeration.

Example

1
"time"

Properties

Name Type Optional Description
SortableFieldTts string true An enumeration.
Enumerated Values
Property Value
SortableFieldTts time
SortableFieldTts label
SortableFieldTts text

SynthesizedAudioFormat

An enumeration.

Example

1
"opus"

Properties

Name Type Optional Description
SynthesizedAudioFormat string true An enumeration.
Enumerated Values
Property Value
SynthesizedAudioFormat opus
SynthesizedAudioFormat mp3
SynthesizedAudioFormat wav

TtsConfig

Configuration for the job execution

Example

1
2
3
4
5
6
7
{
  "model": "tts-dimas-formal",
  "wait": false,
  "pitch": 0,
  "tempo": 1,
  "audio_format": "opus"
}

Properties

Name Type Optional Description
model string true The name of TTS model to use
wait boolean true If set to true, the request blocks until the execution is finished. Otherwise, the request returns job_id which can be used to inquire about the job. For short TTS request, this is typically set to true as the client is expected to wait for the execution. For TTS request > 280 characters, this must be set to false.
pitch number true The pitch offset of the generated speech audio
tempo number true The tempo of the generated speech audio
audio_format SynthesizedAudioFormat true The file format of the generated speech audio

TtsJobRequest

Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
{
  "config": {
    "model": "tts-dimas-formal",
    "wait": false,
    "pitch": 0,
    "tempo": 1,
    "audio_format": "opus"
  },
  "request": {
    "label": "string",
    "text": "Hasil akhir dari pekerjaan ini cukup memuaskan"
  }
}

Properties

Name Type Optional Description
config TtsConfig true The configuration to run a job with
request TtsRequest false The text to synthesize

TtsJobsList

List of TTS jobs

Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
{
  "pagination": {
    "page": 1,
    "per_page": 10,
    "page_count": 1
  },
  "length": 1,
  "data": [
    {
      "job_id": "2fec34e1efb146f7a7431cb35b64550d",
      "status": "complete",
      "created_at": "2019-08-24T14:15:22Z",
      "modified_at": "2019-08-24T14:15:22Z",
      "request": {
        "label": "string",
        "text": "Hasil akhir dari pekerjaan ini cukup memuaskan"
      },
      "result": {
        "format": "opus",
        "duration": 3.7973333333333334,
        "samplerate": 48000,
        "channels": 1
      },
      "job_config": {
        "model": "tts-dimas-formal",
        "wait": false,
        "pitch": 0,
        "tempo": 1,
        "audio_format": "opus"
      }
    }
  ]
}

Properties

Name Type Optional Description
pagination PaginationInfo true -
length integer false -
data [TtsResponse] false -

TtsModel

The model to use for speech synthesis

Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
{
  "name": "tts-dimas-formal",
  "label": "TTS Dimas Formal",
  "language": "Bahasa Indonesia",
  "domain": "formal",
  "voice": "Dimas",
  "gender": "male",
  "channels": 1,
  "samplerate": 48000
}

Properties

Name Type Optional Description
name string false Name of the model
label string true Human-readable name of the model
language string false Language of the model
domain string false The pronunciation style of the TTS model
voice string false The alias for the TTS model persona
gender VoiceGender false The gender of the TTS model
channels integer false The number of channels of the generated audio
samplerate integer false The sample rate of the generated audio

TtsModelList

List of all available TTS models

Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
[
  {
    "name": "tts-dimas-formal",
    "label": "TTS Dimas Formal",
    "language": "Bahasa Indonesia",
    "domain": "formal",
    "voice": "Dimas",
    "gender": "male",
    "channels": 1,
    "samplerate": 48000
  }
]

Properties

Name Type Optional Description
TtsModelList [TtsModel] true List of all available TTS models

TtsRequest

The request payload for a speech synthesis job

Example

1
2
3
4
{
  "label": "string",
  "text": "Hasil akhir dari pekerjaan ini cukup memuaskan"
}

Properties

Name Type Optional Description
label string true An optional label to give to the job
text string false An optional text to generate speech from

TtsResponse

Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
{
  "job_id": "2fec34e1efb146f7a7431cb35b64550d",
  "status": "complete",
  "created_at": "2019-08-24T14:15:22Z",
  "modified_at": "2019-08-24T14:15:22Z",
  "request": {
    "label": "string",
    "text": "Hasil akhir dari pekerjaan ini cukup memuaskan"
  },
  "result": {
    "data": "<base64-encoded audio data>"
  },
  "job_config": {
    "model": "tts-dimas-formal",
    "wait": false,
    "pitch": 0,
    "tempo": 1,
    "audio_format": "opus"
  },
  "model": {
    "name": "tts-dimas-formal",
    "label": "TTS Dimas Formal",
    "language": "Bahasa Indonesia",
    "domain": "formal",
    "voice": "Dimas",
    "gender": "male",
    "channels": 1,
    "samplerate": 48000
  }
}

Properties

Name Type Optional Description
job_id string false The id associated with a job
status JobStatus false The progress status of a job
created_at string(date-time) false The time that the job was created at
modified_at string(date-time) false The time that the job was last modified at
request TtsRequest true The request payload for a speech synthesis job
result true -
job_config TtsConfig true Configuration for the job execution
model TtsModel true The model to use for speech synthesis

TtsResult

The result of a speech synthesis job

Example

1
2
3
4
5
6
7
{
  "data": "<audio data in base64 encoding>",
  "format": "opus",
  "duration": 3.7973333333333334,
  "samplerate": 48000,
  "channels": 1
}

Properties

Name Type Optional Description
data string true The audio data in base64 encoding
path string true The url to retrieve the audio data from. This url expires in 2 hours
format SynthesizedAudioFormat true An enumeration.
duration number true The duration of the synthesized speech audio
samplerate integer true The sample rate of the synthesized speech audio
channels integer true The number of channels of the synthesized speech audio

VoiceGender

An enumeration.

Example

1
"male"

Properties

Name Type Optional Description
VoiceGender string true An enumeration.
Enumerated Values
Property Value
VoiceGender male
VoiceGender female