POST /api/speak/resource¶
Upload an audio file to clone a voice.
Caution
To use this feature, please contact sales.
Request¶
Headers¶
Parameters¶
None
Body as JSON Object¶
Key |
Type |
Required |
Description |
---|---|---|---|
|
string |
Yes |
Format of audio file. Available audio formats are [‘wav’, ‘mp3’, ‘m4a’]. |
Example with cURL
curl --request POST \
--url https://typecast.ai/api/speak/resource \
--header "Content-Type: application/json" \
--header "Authorization: Bearer $API_TOKEN" \
--data '{
"audio_format": "wav",
}'
Response¶
Status Code¶
Status Code |
Description |
---|---|
401 |
|
400 |
JSON object representing an error. See how the error looks. |
200 |
JSON object containing the |
result
consists of the following¶
Key |
Description |
---|---|
|
The ID of the upload URL request API. When making a request to the POST Speak API, it should be included if the tts_mode is set to audio_file. |
|
A URL for uploading an audio file. |
Example
{
"result": {
"speak_resource_id": "63ee55f00000000000000000",
"presigned_url": "https://cdn.typecast.ai..."
}
}
error_code
s in 400
response¶
Error Code |
Description |
---|---|
|
Some required fields are not included in the request body. |
|
When field types are mismatched. |
|
|
Example
{
"message": {
"msg": "invalid audio_format",
"error_code": "app/invalid/audio_format"
}
}