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 Parameters | Type | Description |
---|---|---|
voice_uuid | string | UUID of the voice to which the recording belongs |
Multipart Form Body | Type | Description |
---|---|---|
file | File | Recording audio file (Ensure that the audio file is not silent and has a duration ranging from 1 to 12 seconds) |
emotion | string | Emotion of the recording |
is_active | boolean | If false, the recording is not used to train the voice model |
name | string | Name of the recording |
text | string | Transcript of the recording |
fill | (optional) boolean | Defaulted 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: