Skip to main content
Version: 2.0.0

Create a recording

This endpoint creates a recording for a particular voice.

note

Please ensure the audio file is not silent and has a duration ranging from 1 to 12 seconds. Samples over 12 seconds will be ignored while training.

danger

When providing data to train a voice, please make sure there are no special characters in the text. Special characters can cause unwanted behaviour.

HTTP Request

POST https://app.resemble.ai/api/v2/voices/<voice_uuid>/recordings
URL ParametersTypeDescription
voice_uuidstringUUID of the voice to which the recording belongs
Multipart Form BodyTypeDescription
fileFileRecording audio file (Ensure that the audio file is not silent and has a duration ranging from 1 to 12 seconds)
emotionstringEmotion of the recording
is_activebooleanIf false, the recording is not used to train the voice model
namestringName of the recording
textstringTranscript of the recording
fill(optional) booleanDefaulted to false. If true, the recording will be used for Resemble Fill. Please see Using Resemble Fill Through The API for detailed instructions.

HTTP Response

{
"success": true,
"item": {
"uuid": <string>,
"name": <string>,
"text": <string>,
"emotion": <string>,
"is_active": <boolean>,
"audio_src": Optional<string>,
"created_at": <UTC string>,
"updated_at": <UTC string>,
}
}

Examples

NodeJS
1 2 3 4 5 6 7 8 9 10 11 12 13 14 import { Resemble } from '@resemble/node' Resemble.setApiKey('YOUR_API_TOKEN') const fs = require('fs') const file = fs.createReadStream('happy_sample.wav') const fileSize = fs.statSync('happy_sample.wav').size await Resemble.v2.recordings.create(voiceUuid, { emotion: 'happy', is_active: true, name: 'happy_sample', text: 'Hey, this is a happy sample!' }, file, fileSize)

Try it out

API Key:
Voice UUID:
Multipart Body:
File:
Emotion:
Name:
Text:
Is Active:
Fill: