This commit is contained in:
Hoan HL
2025-10-30 12:08:38 +07:00
parent aa09c15b20
commit 41b26b966b
4 changed files with 178 additions and 41 deletions

View File

@@ -1342,13 +1342,20 @@ const synthCartesia = async(logger, {
id: voice
}
),
...(opts.speed || opts.emotion && {
...(model_id === 'sonic-2' && (opts.speed || opts.emotion) && {
experimentalControls: {
...(opts.speed !== null && opts.speed !== undefined && {speed: opts.speed}),
...(opts.emotion && {emotion: opts.emotion}),
}
})
}),
},
...(model_id === 'sonic-3' && (opts.speed || opts.emotion || opts.volume) && {
generationConfig: {
...(opts.volume !== null && opts.volume !== undefined && {volume: opts.volume}),
...(opts.speed !== null && opts.speed !== undefined && {speed: opts.speed}),
...(opts.emotion !== null && opts.emotion !== undefined && {emotion: opts.emotion}),
}
}),
language: language,
outputFormat: {
container: 'mp3',