Queue up a text for TTS processing.
All API requests require an API key to be included in the headers:
Authorization: Bearer [access-key]
https://infer.intron.health/tts/v1/enqueue
Field | Type | Description | Required | Options | Default |
---|---|---|---|---|---|
text |
String | the text to process | yes | ||
voice_accent |
String | Accent for the speech voice | yes |
|
|
voice_gender |
String | yes | male | female |
curl --location 'https://infer.intron.health/tts/v1/enqueue' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer api-key' \
--data '{
"text":"hello world",
"voice_accent":"swahili",
"voice_gender":"female"
}'
import requests
url = "https://infer.intron.health/tts/v1/enqueue"
payload = {
"text":"hello world",
"voice_accent":"swahili",
"voice_gender":"female"
}
headers = {
"Authorization": "Bearer api-key"
}
response = requests.request("POST", url, headers=headers, json=payload)
print(response.json)
const requestOptions = {
method: "POST",
headers: {
'Authorization': 'Bearer api-Key'
},
body: JSON.stringify(
{
"text":"hello world",
"voice_accent":"swahili",
"voice_gender":"female"
}
)
};
fetch("https://infer.intron.health/tts/v1/enqueue", requestOptions)
.then((response) => response.text())
.then((result) => console.log(result))
.catch((error) => console.error(error));
{
"data": {
"text_id": "12a9767f-b865-4404-91d0-a65d4cdt78fs"
},
"message": "tts text queued for processing",
"status": "Ok"
}
{
"data": {
"audio_duration_in_seconds": 3,
"audio_path": "http://myaudio.wav",
"processing_status": "TTS_TEXT_AUDIO_GENERATED"
},
"message": "text status found",
"status": "Ok"
}