Skip to main content

Create new voice from audio/video file sample

Description

Endpoint allows users to clone voices from audio or video samples. Uploading process is similar to the Blob API.

Notice, for now samples count for voice cloning is limited to 1 sample.

Files submission occurs in several requests:

  1. Client sends a POST request to the endpoint with a list of files to upload. Server verify the request and generates a pre-signed URL for each submitted file.
  2. Client sends a POST request to each pre-signed URL with the file to upload.
  3. Optional: Client might request 'GET /saas/voice/m/voice_id' to receive processing status.

Examples

cURL

1. Submitting a list of voice data to create voice records.

curl -X 'POST' \
'https://api.palabra.ai/saas/voice/clone' \
-H 'accept: application/json' \
-H 'Authorization: Bearer <JWT_TOKEN>' \
-H 'Content-Type: application/json' \
-d '{
"data": {
"name": "Awesome voice name",
"samples": [
{
"filename": "mysample.pm3",
"mime_type": "audio/x-wav",
"display_name": "mysample",
"description": "My voice sample",
"denoise": false,
"lang_code": "en"
}
],
"description": "My awesome voice",
"labels": {
"gender": "Male",
"age_group": "Young",
"mood": "Neutral"
}
}
}'

2. Submitting files

Endpoint respond with a JSON array object containing url and form_data keys for each submitted file. In the following example, we're use cURL command making a POST FormData request to upload a file:

curl -X POST \
-F 'key=bl...0f' \
-F 'x-amz-algorithm=AWS4-HMAC-SHA256' \
... Other form data fields from the response...
-F 'policy=eyJleHBpc...zA3WiJ9XX0=' \
-F 'x-amz-signature=463f78071...847af0c' \
-F file=@<file path at your file system> \
https://url.from.the/response/

References

Request Body REQUIRED
data object REQUIRED
name Name REQUIRED

Possible values: 3 ≤ length ≤ 64, Value must match regular expression ^[\w\-. ]+$

Name of the of the voice

samples object[] REQUIRED

List of voice samples to upload

filename Filename REQUIRED

Possible values: 3 ≤ length ≤ 255, Value must match regular expression ^[\w\-. '\"()]+$`

File name. Ex: 'awesome_file.mp4'

mime_type AllowedMIMEType REQUIRED

Possible values: [audio/x-wav, audio/wav, audio/mp3, audio/x-m4a, audio/mpeg, audio/flac, video/webm, video/mp4, video/mpeg]

Allowed MIME types

display_name Display Name

File display name.

description Description

File description.

item_id Item Id

Identifier of the item. It represents the file ID in the request when uploading multiple files. Use it to identify the upload URL in the response related to the target file.

denoise Denoise

Set denoise to true denoise if a sample contains background noise

lang_code
description Description

Description of the file.

labels

Voice labels.

Responses
200

Successful Response

Schema OPTIONAL
ok Ok OPTIONAL

Indicates if the request was successful or not.

data object
utc_created_at date-time
voice_id uuid
user_id User Id
name Name
voice_type VoiceType

Possible values: [instantly_cloned, instantly_cloned_builtin]

processing_status VoiceProcessingStatus

Possible values: [created, pending, ready, failed]

description Description OPTIONAL
labels OPTIONAL
lang_code OPTIONAL
samples object[]

Pre-signed links to upload voice samples

item_id Item Id

Possible values: 1 ≤ length ≤ 36

Identifier of the item from upload request.

blob_id Blob Id

Blob ID

url uri

Possible values: 1 ≤ length ≤ 2083

Upload URL

form_data Form Data

Form data for uploading the file

default

Default Response

Schema OPTIONAL
ok Ok OPTIONAL

Indicates if the request was successful or not.

errors object[]

List of errors

type uri

Possible values: 1 ≤ length ≤ 2083

A string containing a URI reference that identifies the problem type.

status Status

Possible values: 399 < value < 600

A number indicating the HTTP status code.

title Title

Possible values: 5 ≤ length

A string containing a short, human-readable summary of the problem type.

detail Detail

Possible values: 5 ≤ length

A string containing a human-readable explanation specific to this occurrence of the problem.

instance Instance

Possible values: 1 ≤ length

A string containing a URI reference that identifies the specific occurrence of the problem.

error_code Error Code

A Number that indicates the error type that occurred.