@cartesia/cartesia-js 2.1.5 → 2.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api/resources/apiStatus/client/Client.js +1 -1
- package/api/resources/datasets/client/Client.d.ts +2 -5
- package/api/resources/datasets/client/Client.js +6 -9
- package/api/resources/datasets/client/requests/UploadDatasetFileRequest.d.ts +0 -4
- package/api/resources/infill/client/Client.d.ts +9 -1
- package/api/resources/infill/client/Client.js +10 -2
- package/api/resources/voices/client/Client.d.ts +51 -41
- package/api/resources/voices/client/Client.js +83 -73
- package/api/resources/voices/types/BaseVoiceId.d.ts +1 -1
- package/api/resources/voices/types/CreateVoiceRequest.d.ts +1 -0
- package/api/resources/voices/types/LocalizeVoiceRequest.d.ts +6 -1
- package/dist/api/resources/apiStatus/client/Client.js +1 -1
- package/dist/api/resources/datasets/client/Client.d.ts +2 -5
- package/dist/api/resources/datasets/client/Client.js +6 -9
- package/dist/api/resources/datasets/client/requests/UploadDatasetFileRequest.d.ts +0 -4
- package/dist/api/resources/infill/client/Client.d.ts +9 -1
- package/dist/api/resources/infill/client/Client.js +10 -2
- package/dist/api/resources/voices/client/Client.d.ts +51 -41
- package/dist/api/resources/voices/client/Client.js +83 -73
- package/dist/api/resources/voices/types/BaseVoiceId.d.ts +1 -1
- package/dist/api/resources/voices/types/CreateVoiceRequest.d.ts +1 -0
- package/dist/api/resources/voices/types/LocalizeVoiceRequest.d.ts +6 -1
- package/dist/serialization/resources/voices/types/CreateVoiceRequest.d.ts +2 -0
- package/dist/serialization/resources/voices/types/CreateVoiceRequest.js +2 -0
- package/dist/serialization/resources/voices/types/LocalizeVoiceRequest.d.ts +3 -2
- package/dist/serialization/resources/voices/types/LocalizeVoiceRequest.js +3 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/reference.md +91 -124
- package/serialization/resources/voices/types/CreateVoiceRequest.d.ts +2 -0
- package/serialization/resources/voices/types/CreateVoiceRequest.js +2 -0
- package/serialization/resources/voices/types/LocalizeVoiceRequest.d.ts +3 -2
- package/serialization/resources/voices/types/LocalizeVoiceRequest.js +3 -2
- package/version.d.ts +1 -1
- package/version.js +1 -1
|
@@ -66,7 +66,7 @@ class ApiStatus {
|
|
|
66
66
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
67
67
|
url: (_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CartesiaEnvironment.Production,
|
|
68
68
|
method: "GET",
|
|
69
|
-
headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.
|
|
69
|
+
headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.7", "User-Agent": "@cartesia/cartesia-js/2.1.7", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
70
70
|
contentType: "application/json",
|
|
71
71
|
requestType: "json",
|
|
72
72
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -45,7 +45,7 @@ export declare class Datasets {
|
|
|
45
45
|
*
|
|
46
46
|
* @example
|
|
47
47
|
* await client.datasets.create({
|
|
48
|
-
* name: "
|
|
48
|
+
* name: "name"
|
|
49
49
|
* })
|
|
50
50
|
*/
|
|
51
51
|
create(request: Cartesia.CreateDatasetRequest, requestOptions?: Datasets.RequestOptions): Promise<Cartesia.Dataset>;
|
|
@@ -54,7 +54,7 @@ export declare class Datasets {
|
|
|
54
54
|
* @param {Datasets.RequestOptions} requestOptions - Request-specific configuration.
|
|
55
55
|
*
|
|
56
56
|
* @example
|
|
57
|
-
* await client.datasets.listFiles("
|
|
57
|
+
* await client.datasets.listFiles("id")
|
|
58
58
|
*/
|
|
59
59
|
listFiles(id: string, requestOptions?: Datasets.RequestOptions): Promise<Cartesia.PaginatedDatasetFiles>;
|
|
60
60
|
/**
|
|
@@ -62,9 +62,6 @@ export declare class Datasets {
|
|
|
62
62
|
* @param {string} id
|
|
63
63
|
* @param {Cartesia.UploadDatasetFileRequest} request
|
|
64
64
|
* @param {Datasets.RequestOptions} requestOptions - Request-specific configuration.
|
|
65
|
-
*
|
|
66
|
-
* @example
|
|
67
|
-
* await client.datasets.uploadFile(fs.createReadStream("/path/to/your/file"), "string", {})
|
|
68
65
|
*/
|
|
69
66
|
uploadFile(file: File | fs.ReadStream | Blob, id: string, request: Cartesia.UploadDatasetFileRequest, requestOptions?: Datasets.RequestOptions): Promise<void>;
|
|
70
67
|
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
@@ -70,7 +70,7 @@ class Datasets {
|
|
|
70
70
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
71
71
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CartesiaEnvironment.Production, "/datasets/"),
|
|
72
72
|
method: "GET",
|
|
73
|
-
headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.
|
|
73
|
+
headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.7", "User-Agent": "@cartesia/cartesia-js/2.1.7", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
74
74
|
contentType: "application/json",
|
|
75
75
|
requestType: "json",
|
|
76
76
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -113,7 +113,7 @@ class Datasets {
|
|
|
113
113
|
*
|
|
114
114
|
* @example
|
|
115
115
|
* await client.datasets.create({
|
|
116
|
-
* name: "
|
|
116
|
+
* name: "name"
|
|
117
117
|
* })
|
|
118
118
|
*/
|
|
119
119
|
create(request, requestOptions) {
|
|
@@ -122,7 +122,7 @@ class Datasets {
|
|
|
122
122
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
123
123
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CartesiaEnvironment.Production, "/datasets/"),
|
|
124
124
|
method: "POST",
|
|
125
|
-
headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.
|
|
125
|
+
headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.7", "User-Agent": "@cartesia/cartesia-js/2.1.7", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
126
126
|
contentType: "application/json",
|
|
127
127
|
requestType: "json",
|
|
128
128
|
body: serializers.CreateDatasetRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -165,7 +165,7 @@ class Datasets {
|
|
|
165
165
|
* @param {Datasets.RequestOptions} requestOptions - Request-specific configuration.
|
|
166
166
|
*
|
|
167
167
|
* @example
|
|
168
|
-
* await client.datasets.listFiles("
|
|
168
|
+
* await client.datasets.listFiles("id")
|
|
169
169
|
*/
|
|
170
170
|
listFiles(id, requestOptions) {
|
|
171
171
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -173,7 +173,7 @@ class Datasets {
|
|
|
173
173
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
174
174
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CartesiaEnvironment.Production, `/datasets/${encodeURIComponent(id)}/files`),
|
|
175
175
|
method: "GET",
|
|
176
|
-
headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.
|
|
176
|
+
headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.7", "User-Agent": "@cartesia/cartesia-js/2.1.7", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
177
177
|
contentType: "application/json",
|
|
178
178
|
requestType: "json",
|
|
179
179
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -215,9 +215,6 @@ class Datasets {
|
|
|
215
215
|
* @param {string} id
|
|
216
216
|
* @param {Cartesia.UploadDatasetFileRequest} request
|
|
217
217
|
* @param {Datasets.RequestOptions} requestOptions - Request-specific configuration.
|
|
218
|
-
*
|
|
219
|
-
* @example
|
|
220
|
-
* await client.datasets.uploadFile(fs.createReadStream("/path/to/your/file"), "string", {})
|
|
221
218
|
*/
|
|
222
219
|
uploadFile(file, id, request, requestOptions) {
|
|
223
220
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -229,7 +226,7 @@ class Datasets {
|
|
|
229
226
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
230
227
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CartesiaEnvironment.Production, `/datasets/${encodeURIComponent(id)}/files`),
|
|
231
228
|
method: "POST",
|
|
232
|
-
headers: Object.assign(Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.
|
|
229
|
+
headers: Object.assign(Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.7", "User-Agent": "@cartesia/cartesia-js/2.1.7", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), _maybeEncodedRequest.headers), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
233
230
|
requestType: "file",
|
|
234
231
|
duplex: _maybeEncodedRequest.duplex,
|
|
235
232
|
body: _maybeEncodedRequest.body,
|
|
@@ -36,11 +36,19 @@ export declare class Infill {
|
|
|
36
36
|
/**
|
|
37
37
|
* Generate audio that smoothly connects two existing audio segments. This is useful for inserting new speech between existing speech segments while maintaining natural transitions.
|
|
38
38
|
*
|
|
39
|
-
* The cost is 1 credit per character of the infill text plus a fixed cost of 300 credits
|
|
39
|
+
* **The cost is 1 credit per character of the infill text plus a fixed cost of 300 credits.**
|
|
40
40
|
*
|
|
41
41
|
* Only the `sonic-preview` model is supported for infill at this time.
|
|
42
42
|
*
|
|
43
43
|
* At least one of `left_audio` or `right_audio` must be provided.
|
|
44
|
+
*
|
|
45
|
+
* As with all generative models, there's some inherent variability, but here's some tips we recommend to get the best results from infill:
|
|
46
|
+
* - Use longer infill transcripts
|
|
47
|
+
* - This gives the model more flexibility to adapt to the rest of the audio
|
|
48
|
+
* - Target natural pauses in the audio when deciding where to clip
|
|
49
|
+
* - This means you don't need word-level timestamps to be as precise
|
|
50
|
+
* - Clip right up to the start and end of the audio segment you want infilled, keeping as much silence in the left/right audio segments as possible
|
|
51
|
+
* - This helps the model generate more natural transitions
|
|
44
52
|
*/
|
|
45
53
|
bytes(leftAudio: File | fs.ReadStream | Blob, rightAudio: File | fs.ReadStream | Blob, request: Cartesia.InfillBytesRequest, requestOptions?: Infill.RequestOptions): Promise<stream.Readable>;
|
|
46
54
|
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
@@ -62,11 +62,19 @@ class Infill {
|
|
|
62
62
|
/**
|
|
63
63
|
* Generate audio that smoothly connects two existing audio segments. This is useful for inserting new speech between existing speech segments while maintaining natural transitions.
|
|
64
64
|
*
|
|
65
|
-
* The cost is 1 credit per character of the infill text plus a fixed cost of 300 credits
|
|
65
|
+
* **The cost is 1 credit per character of the infill text plus a fixed cost of 300 credits.**
|
|
66
66
|
*
|
|
67
67
|
* Only the `sonic-preview` model is supported for infill at this time.
|
|
68
68
|
*
|
|
69
69
|
* At least one of `left_audio` or `right_audio` must be provided.
|
|
70
|
+
*
|
|
71
|
+
* As with all generative models, there's some inherent variability, but here's some tips we recommend to get the best results from infill:
|
|
72
|
+
* - Use longer infill transcripts
|
|
73
|
+
* - This gives the model more flexibility to adapt to the rest of the audio
|
|
74
|
+
* - Target natural pauses in the audio when deciding where to clip
|
|
75
|
+
* - This means you don't need word-level timestamps to be as precise
|
|
76
|
+
* - Clip right up to the start and end of the audio segment you want infilled, keeping as much silence in the left/right audio segments as possible
|
|
77
|
+
* - This helps the model generate more natural transitions
|
|
70
78
|
*/
|
|
71
79
|
bytes(leftAudio, rightAudio, request, requestOptions) {
|
|
72
80
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -105,7 +113,7 @@ class Infill {
|
|
|
105
113
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
106
114
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CartesiaEnvironment.Production, "/infill/bytes"),
|
|
107
115
|
method: "POST",
|
|
108
|
-
headers: Object.assign(Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.
|
|
116
|
+
headers: Object.assign(Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.7", "User-Agent": "@cartesia/cartesia-js/2.1.7", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), _maybeEncodedRequest.headers), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
109
117
|
requestType: "file",
|
|
110
118
|
duplex: _maybeEncodedRequest.duplex,
|
|
111
119
|
body: _maybeEncodedRequest.body,
|
|
@@ -40,24 +40,42 @@ export declare class Voices {
|
|
|
40
40
|
*/
|
|
41
41
|
list(requestOptions?: Voices.RequestOptions): Promise<Cartesia.Voice[]>;
|
|
42
42
|
/**
|
|
43
|
-
*
|
|
43
|
+
* Clone a voice from an audio clip. This endpoint has two modes, stability and similarity.
|
|
44
|
+
*
|
|
45
|
+
* Similarity mode clones are more similar to the source clip, but may reproduce background noise. For these, use an audio clip about 5 seconds long.
|
|
46
|
+
*
|
|
47
|
+
* Stability mode clones are more stable, but may not sound as similar to the source clip. For these, use an audio clip 10-20 seconds long.
|
|
48
|
+
*
|
|
49
|
+
* @param {File | fs.ReadStream | Blob} clip
|
|
50
|
+
* @param {Cartesia.CloneVoiceRequest} request
|
|
44
51
|
* @param {Voices.RequestOptions} requestOptions - Request-specific configuration.
|
|
45
52
|
*
|
|
46
53
|
* @example
|
|
47
|
-
* await client.voices.
|
|
48
|
-
* name: "
|
|
49
|
-
* description: "
|
|
50
|
-
*
|
|
51
|
-
* language: "en"
|
|
54
|
+
* await client.voices.clone(fs.createReadStream("/path/to/your/file"), {
|
|
55
|
+
* name: "A high-stability cloned voice",
|
|
56
|
+
* description: "Copied from Cartesia docs",
|
|
57
|
+
* mode: "stability",
|
|
58
|
+
* language: "en",
|
|
59
|
+
* enhance: true
|
|
60
|
+
* })
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* await client.voices.clone(fs.createReadStream("/path/to/your/file"), {
|
|
64
|
+
* name: "A high-similarity cloned voice",
|
|
65
|
+
* description: "Copied from Cartesia docs",
|
|
66
|
+
* mode: "similarity",
|
|
67
|
+
* language: "en",
|
|
68
|
+
* transcript: "A transcript of the words spoken in the audio clip.",
|
|
69
|
+
* enhance: false
|
|
52
70
|
* })
|
|
53
71
|
*/
|
|
54
|
-
|
|
72
|
+
clone(clip: File | fs.ReadStream | Blob, request: Cartesia.CloneVoiceRequest, requestOptions?: Voices.RequestOptions): Promise<Cartesia.VoiceMetadata>;
|
|
55
73
|
/**
|
|
56
74
|
* @param {Cartesia.VoiceId} id
|
|
57
75
|
* @param {Voices.RequestOptions} requestOptions - Request-specific configuration.
|
|
58
76
|
*
|
|
59
77
|
* @example
|
|
60
|
-
* await client.voices.delete("
|
|
78
|
+
* await client.voices.delete("id")
|
|
61
79
|
*/
|
|
62
80
|
delete(id: Cartesia.VoiceId, requestOptions?: Voices.RequestOptions): Promise<void>;
|
|
63
81
|
/**
|
|
@@ -66,9 +84,9 @@ export declare class Voices {
|
|
|
66
84
|
* @param {Voices.RequestOptions} requestOptions - Request-specific configuration.
|
|
67
85
|
*
|
|
68
86
|
* @example
|
|
69
|
-
* await client.voices.update("
|
|
70
|
-
* name: "
|
|
71
|
-
* description: "
|
|
87
|
+
* await client.voices.update("id", {
|
|
88
|
+
* name: "name",
|
|
89
|
+
* description: "description"
|
|
72
90
|
* })
|
|
73
91
|
*/
|
|
74
92
|
update(id: Cartesia.VoiceId, request: Cartesia.UpdateVoiceRequest, requestOptions?: Voices.RequestOptions): Promise<Cartesia.Voice>;
|
|
@@ -77,22 +95,26 @@ export declare class Voices {
|
|
|
77
95
|
* @param {Voices.RequestOptions} requestOptions - Request-specific configuration.
|
|
78
96
|
*
|
|
79
97
|
* @example
|
|
80
|
-
* await client.voices.get("
|
|
98
|
+
* await client.voices.get("id")
|
|
81
99
|
*/
|
|
82
100
|
get(id: Cartesia.VoiceId, requestOptions?: Voices.RequestOptions): Promise<Cartesia.Voice>;
|
|
83
101
|
/**
|
|
102
|
+
* Create a new voice from an existing voice localized to a new language and dialect.
|
|
103
|
+
*
|
|
84
104
|
* @param {Cartesia.LocalizeVoiceRequest} request
|
|
85
105
|
* @param {Voices.RequestOptions} requestOptions - Request-specific configuration.
|
|
86
106
|
*
|
|
87
107
|
* @example
|
|
88
108
|
* await client.voices.localize({
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
*
|
|
109
|
+
* voiceId: "694f9389-aac1-45b6-b726-9d9369183238",
|
|
110
|
+
* name: "Sarah Peninsular Spanish",
|
|
111
|
+
* description: "Sarah Voice in Peninsular Spanish",
|
|
112
|
+
* language: "es",
|
|
113
|
+
* originalSpeakerGender: "female",
|
|
114
|
+
* dialect: "pe"
|
|
93
115
|
* })
|
|
94
116
|
*/
|
|
95
|
-
localize(request: Cartesia.LocalizeVoiceRequest, requestOptions?: Voices.RequestOptions): Promise<Cartesia.
|
|
117
|
+
localize(request: Cartesia.LocalizeVoiceRequest, requestOptions?: Voices.RequestOptions): Promise<Cartesia.VoiceMetadata>;
|
|
96
118
|
/**
|
|
97
119
|
* @param {Cartesia.MixVoicesRequest} request
|
|
98
120
|
* @param {Voices.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -100,43 +122,31 @@ export declare class Voices {
|
|
|
100
122
|
* @example
|
|
101
123
|
* await client.voices.mix({
|
|
102
124
|
* voices: [{
|
|
103
|
-
* id: "
|
|
125
|
+
* id: "id",
|
|
126
|
+
* weight: 1.1
|
|
127
|
+
* }, {
|
|
128
|
+
* id: "id",
|
|
104
129
|
* weight: 1.1
|
|
105
130
|
* }]
|
|
106
131
|
* })
|
|
107
132
|
*/
|
|
108
133
|
mix(request: Cartesia.MixVoicesRequest, requestOptions?: Voices.RequestOptions): Promise<Cartesia.EmbeddingResponse>;
|
|
109
134
|
/**
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
* Similarity mode clones are more similar to the source clip, but may reproduce background noise. For these, use an audio clip about 5 seconds long.
|
|
113
|
-
*
|
|
114
|
-
* Stability mode clones are more stable, but may not sound as similar to the source clip. For these, use an audio clip 10-20 seconds long.
|
|
135
|
+
* Create voice from raw features. If you'd like to clone a voice from an audio file, please use Clone Voice instead.
|
|
115
136
|
*
|
|
116
|
-
* @param {
|
|
117
|
-
* @param {Cartesia.CloneVoiceRequest} request
|
|
137
|
+
* @param {Cartesia.CreateVoiceRequest} request
|
|
118
138
|
* @param {Voices.RequestOptions} requestOptions - Request-specific configuration.
|
|
119
139
|
*
|
|
120
140
|
* @example
|
|
121
|
-
* await client.voices.
|
|
122
|
-
* name: "
|
|
123
|
-
* description: "
|
|
124
|
-
*
|
|
125
|
-
* language: "en",
|
|
126
|
-
* enhance: true
|
|
127
|
-
* })
|
|
128
|
-
*
|
|
129
|
-
* @example
|
|
130
|
-
* await client.voices.clone(fs.createReadStream("/path/to/your/file"), {
|
|
131
|
-
* name: "A high-similarity cloned voice",
|
|
132
|
-
* description: "Copied from Cartesia docs",
|
|
133
|
-
* mode: "similarity",
|
|
141
|
+
* await client.voices.create({
|
|
142
|
+
* name: "My Custom Voice",
|
|
143
|
+
* description: "A custom voice created through the API",
|
|
144
|
+
* embedding: [],
|
|
134
145
|
* language: "en",
|
|
135
|
-
*
|
|
136
|
-
* enhance: false
|
|
146
|
+
* baseVoiceId: "123e4567-e89b-12d3-a456-426614174000"
|
|
137
147
|
* })
|
|
138
148
|
*/
|
|
139
|
-
|
|
149
|
+
create(request: Cartesia.CreateVoiceRequest, requestOptions?: Voices.RequestOptions): Promise<Cartesia.VoiceMetadata>;
|
|
140
150
|
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
141
151
|
"X-API-Key": string | undefined;
|
|
142
152
|
}>;
|