POST /voice/tts
Synthesizes speech synchronously
Receives text and data configs and synthesize speech in different voices and format using state-of-the-art deep neural networks. This service synthesizes speech synchronously and the results will be available after all text input has been processed.
Using config object you can can specify audio configs such as audioEncoding and sampleRateHertz. We will support different languages so you can choose the languageCode. using voiceSelectionParams you can choose between the supported voices with specifying voiceId. Voices differ in gender, tone and style.
Body
Required
Receives a json including input text, voice parameteres and audio config.
-
synthesisInput
object Required The Synthesizer requires either plain text or SSML as input. Only provide text OR ssml. Providing both will result in a bad request response.
-
voiceConfig
object Required The desired voice of the synthesized audio.
-
audioConfig
object Required The configuration of the synthesized audio.
Responses
-
OK. Speech Synthesized.
-
This response means that server could not understand the request due to invalid syntax.
-
Authentication is needed to get requested response. This is similar to 403, but in this case, authentication is possible.
-
Client does not have access rights to the content so server is rejecting to give proper response.
-
The request method is known by the server but has been disabled and cannot be used.
-
The media format of the requested data is not supported by the server, so the server is rejecting the request.
-
The user has sent too many requests in a given amount of time ("rate limiting").
-
The server has encountered a situation it doesn't know how to handle.
-
The request method is not supported by the server and cannot be handled.
curl \
-X POST https://api.amerandish.com/v1/voice/tts \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"synthesisInput":{"text":"Speak This."},"voiceConfig":{"languageCode":"fa","voiceId":"b2d8dfca-7d78-47f8-b976-c85b15bbc134","name":"speaker-2","gender":"female"},"audioConfig":{"audioEncoding":"MP3","speakingRate":1.2,"pitch":0.0,"volumeGainDb":-2,"sampleRateHertz":16000}}'
{
"synthesisInput": {
"text": "Speak This."
},
"voiceConfig": {
"languageCode": "fa",
"voiceId": "b2d8dfca-7d78-47f8-b976-c85b15bbc134",
"name": "speaker-2",
"gender": "female"
},
"audioConfig": {
"audioEncoding": "MP3",
"speakingRate": 1.2,
"pitch": 0.0,
"volumeGainDb": -2,
"sampleRateHertz": 16000
}
}
{
"synthesisInput": {
"text": "string",
"ssml": "string"
},
"voiceConfig": {
"voiceId": "string",
"languageCode": "fa",
"name": "string",
"gender": "female"
},
"audioConfig": {
"audioEncoding": "LINEAR16",
"sampleRateHertz": 16000,
"speakingRate": 42.0,
"pitch": 42.0,
"volumeGainDb": 42.0
}
}
{
"audioContent": "string"
}
{
"audioContent": "string"
}
{
"code": 400,
"message": "Bad Request. Invalid JSON object."
}
{
"status": "string",
"detail": "string",
"title": "string",
"type": "string"
}
{
"code": 401,
"message": "Unautherized. Invalid Authorization Token."
}
{
"status": "string",
"detail": "string",
"title": "string",
"type": "string"
}
{
"code": 403,
"message": "Forbidden. Do not have access right to resource."
}
{
"status": "string",
"detail": "string",
"title": "string",
"type": "string"
}
{
"code": 405,
"message": "Method Not Allowed."
}
{
"status": "string",
"detail": "string",
"title": "string",
"type": "string"
}
{
"code": 415,
"message": "Unsupported Media Type. Please change requested media type."
}
{
"status": "string",
"detail": "string",
"title": "string",
"type": "string"
}
{
"code": 429,
"message": "Too Many Requests. Your request is blocked due to exceeding rate limiting."
}
{
"status": "string",
"detail": "string",
"title": "string",
"type": "string"
}
{
"code": 500,
"message": "Internal Server Error. Please retry later."
}
{
"status": "string",
"detail": "string",
"title": "string",
"type": "string"
}
{
"code": 501,
"message": "Not Implemented. This functionality is not implemented yet."
}
{
"status": "string",
"detail": "string",
"title": "string",
"type": "string"
}