@cartesia/cartesia-js 3.0.0-b3 → 3.0.0-b5
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/CHANGELOG.md +17 -0
- package/README.md +17 -13
- package/backcompat/index.d.mts +36 -0
- package/backcompat/index.d.mts.map +1 -0
- package/backcompat/index.d.ts +36 -0
- package/backcompat/index.d.ts.map +1 -0
- package/backcompat/index.js +266 -0
- package/backcompat/index.js.map +1 -0
- package/backcompat/index.mjs +261 -0
- package/backcompat/index.mjs.map +1 -0
- package/client.d.mts +2 -2
- package/client.d.mts.map +1 -1
- package/client.d.ts +2 -2
- package/client.d.ts.map +1 -1
- package/client.js.map +1 -1
- package/client.mjs.map +1 -1
- package/index.d.mts +1 -0
- package/index.d.mts.map +1 -1
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.js +3 -1
- package/index.js.map +1 -1
- package/index.mjs +1 -0
- package/index.mjs.map +1 -1
- package/internal/tslib.js +4 -0
- package/package.json +11 -1
- package/resources/access-token.d.mts +5 -0
- package/resources/access-token.d.mts.map +1 -1
- package/resources/access-token.d.ts +5 -0
- package/resources/access-token.d.ts.map +1 -1
- package/resources/agents/agents.js +1 -1
- package/resources/agents/agents.js.map +1 -1
- package/resources/agents/agents.mjs +1 -1
- package/resources/agents/agents.mjs.map +1 -1
- package/resources/agents/metrics/index.d.mts +1 -1
- package/resources/agents/metrics/index.d.mts.map +1 -1
- package/resources/agents/metrics/index.d.ts +1 -1
- package/resources/agents/metrics/index.d.ts.map +1 -1
- package/resources/agents/metrics/index.js.map +1 -1
- package/resources/agents/metrics/index.mjs.map +1 -1
- package/resources/agents/metrics/metrics.d.mts +2 -2
- package/resources/agents/metrics/metrics.d.mts.map +1 -1
- package/resources/agents/metrics/metrics.d.ts +2 -2
- package/resources/agents/metrics/metrics.d.ts.map +1 -1
- package/resources/agents/metrics/metrics.js.map +1 -1
- package/resources/agents/metrics/metrics.mjs.map +1 -1
- package/resources/agents/metrics/results.d.mts +23 -22
- package/resources/agents/metrics/results.d.mts.map +1 -1
- package/resources/agents/metrics/results.d.ts +23 -22
- package/resources/agents/metrics/results.d.ts.map +1 -1
- package/resources/agents/metrics/results.js +4 -5
- package/resources/agents/metrics/results.js.map +1 -1
- package/resources/agents/metrics/results.mjs +4 -5
- package/resources/agents/metrics/results.mjs.map +1 -1
- package/resources/index.d.mts +1 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/infill.d.mts +3 -4
- package/resources/infill.d.mts.map +1 -1
- package/resources/infill.d.ts +3 -4
- package/resources/infill.d.ts.map +1 -1
- package/resources/infill.js +0 -2
- package/resources/infill.js.map +1 -1
- package/resources/infill.mjs +0 -2
- package/resources/infill.mjs.map +1 -1
- package/resources/pronunciation-dicts.d.mts +0 -8
- package/resources/pronunciation-dicts.d.mts.map +1 -1
- package/resources/pronunciation-dicts.d.ts +0 -8
- package/resources/pronunciation-dicts.d.ts.map +1 -1
- package/resources/pronunciation-dicts.js +0 -18
- package/resources/pronunciation-dicts.js.map +1 -1
- package/resources/pronunciation-dicts.mjs +0 -18
- package/resources/pronunciation-dicts.mjs.map +1 -1
- package/resources/stt.d.mts +1 -104
- package/resources/stt.d.mts.map +1 -1
- package/resources/stt.d.ts +1 -104
- package/resources/stt.d.ts.map +1 -1
- package/resources/tts/tts.d.mts +79 -115
- package/resources/tts/tts.d.mts.map +1 -1
- package/resources/tts/tts.d.ts +79 -115
- package/resources/tts/tts.d.ts.map +1 -1
- package/resources/voice-changer.d.mts +2 -2
- package/resources/voice-changer.d.mts.map +1 -1
- package/resources/voice-changer.d.ts +2 -2
- package/resources/voice-changer.d.ts.map +1 -1
- package/resources/voices.d.mts +70 -34
- package/resources/voices.d.mts.map +1 -1
- package/resources/voices.d.ts +70 -34
- package/resources/voices.d.ts.map +1 -1
- package/resources/voices.js +45 -3
- package/resources/voices.js.map +1 -1
- package/resources/voices.mjs +45 -3
- package/resources/voices.mjs.map +1 -1
- package/src/backcompat/index.ts +302 -0
- package/src/client.ts +2 -0
- package/src/index.ts +1 -0
- package/src/resources/access-token.ts +6 -0
- package/src/resources/agents/agents.ts +1 -1
- package/src/resources/agents/metrics/index.ts +1 -0
- package/src/resources/agents/metrics/metrics.ts +2 -0
- package/src/resources/agents/metrics/results.ts +27 -23
- package/src/resources/index.ts +1 -0
- package/src/resources/infill.ts +3 -4
- package/src/resources/pronunciation-dicts.ts +0 -20
- package/src/resources/stt.ts +102 -104
- package/src/resources/tts/tts.ts +146 -128
- package/src/resources/voice-changer.ts +2 -2
- package/src/resources/voices.ts +105 -38
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/resources/voices.d.ts
CHANGED
|
@@ -8,42 +8,81 @@ export declare class Voices extends APIResource {
|
|
|
8
8
|
* Update the name, description, and gender of a voice. To set the gender back to
|
|
9
9
|
* the default, set the gender to `null`. If gender is not specified, the gender
|
|
10
10
|
* will not be updated.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const voice = await client.voices.update('id', {
|
|
15
|
+
* description: 'description',
|
|
16
|
+
* name: 'name',
|
|
17
|
+
* });
|
|
18
|
+
* ```
|
|
11
19
|
*/
|
|
12
20
|
update(id: string, body: VoiceUpdateParams, options?: RequestOptions): APIPromise<Voice>;
|
|
13
21
|
/**
|
|
14
22
|
* List Voices
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* // Automatically fetches more pages as needed.
|
|
27
|
+
* for await (const voice of client.voices.list()) {
|
|
28
|
+
* // ...
|
|
29
|
+
* }
|
|
30
|
+
* ```
|
|
15
31
|
*/
|
|
16
32
|
list(query?: VoiceListParams | null | undefined, options?: RequestOptions): PagePromise<VoicesCursorIDPage, Voice>;
|
|
17
33
|
/**
|
|
18
34
|
* Delete Voice
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```ts
|
|
38
|
+
* await client.voices.delete('id');
|
|
39
|
+
* ```
|
|
19
40
|
*/
|
|
20
41
|
delete(id: string, options?: RequestOptions): APIPromise<void>;
|
|
21
42
|
/**
|
|
22
43
|
* Clone a high similarity voice from an audio clip. Clones are more similar to the
|
|
23
44
|
* source clip, but may reproduce background noise. For these, use an audio clip
|
|
24
45
|
* about 5 seconds long.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```ts
|
|
49
|
+
* const voiceMetadata = await client.voices.clone();
|
|
50
|
+
* ```
|
|
25
51
|
*/
|
|
26
52
|
clone(body: VoiceCloneParams, options?: RequestOptions): APIPromise<VoiceMetadata>;
|
|
27
53
|
/**
|
|
28
54
|
* Get Voice
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```ts
|
|
58
|
+
* const voice = await client.voices.get('id');
|
|
59
|
+
* ```
|
|
29
60
|
*/
|
|
30
|
-
get(id: string, options?: RequestOptions): APIPromise<Voice>;
|
|
61
|
+
get(id: string, query?: VoiceGetParams | null | undefined, options?: RequestOptions): APIPromise<Voice>;
|
|
31
62
|
/**
|
|
32
63
|
* Create a new voice from an existing voice localized to a new language and
|
|
33
64
|
* dialect.
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```ts
|
|
68
|
+
* const voiceMetadata = await client.voices.localize({
|
|
69
|
+
* description: 'description',
|
|
70
|
+
* language: 'en',
|
|
71
|
+
* name: 'name',
|
|
72
|
+
* original_speaker_gender: 'male',
|
|
73
|
+
* voice_id: 'voice_id',
|
|
74
|
+
* });
|
|
75
|
+
* ```
|
|
34
76
|
*/
|
|
35
77
|
localize(body: VoiceLocalizeParams, options?: RequestOptions): APIPromise<VoiceMetadata>;
|
|
36
78
|
}
|
|
37
79
|
export type VoicesCursorIDPage = CursorIDPage<Voice>;
|
|
38
80
|
export type GenderPresentation = 'masculine' | 'feminine' | 'gender_neutral';
|
|
39
81
|
/**
|
|
40
|
-
* The language that the given voice should speak the transcript in.
|
|
41
|
-
*
|
|
42
|
-
* Options: English (en), French (fr), German (de), Spanish (es), Portuguese (pt),
|
|
43
|
-
* Chinese (zh), Japanese (ja), Hindi (hi), Italian (it), Korean (ko), Dutch (nl),
|
|
44
|
-
* Polish (pl), Russian (ru), Swedish (sv), Turkish (tr).
|
|
82
|
+
* The language that the given voice should speak the transcript in. For valid
|
|
83
|
+
* options, see [Models](/build-with-cartesia/tts-models).
|
|
45
84
|
*/
|
|
46
|
-
export type SupportedLanguage = 'en' | 'fr' | 'de' | 'es' | 'pt' | 'zh' | 'ja' | 'hi' | 'it' | 'ko' | 'nl' | 'pl' | 'ru' | 'sv' | 'tr';
|
|
85
|
+
export type SupportedLanguage = 'en' | 'fr' | 'de' | 'es' | 'pt' | 'zh' | 'ja' | 'hi' | 'it' | 'ko' | 'nl' | 'pl' | 'ru' | 'sv' | 'tr' | 'tl' | 'bg' | 'ro' | 'ar' | 'cs' | 'el' | 'fi' | 'hr' | 'ms' | 'sk' | 'da' | 'ta' | 'uk' | 'hu' | 'no' | 'vi' | 'bn' | 'th' | 'he' | 'ka' | 'id' | 'te' | 'gu' | 'kn' | 'ml' | 'mr' | 'pa';
|
|
47
86
|
export interface Voice {
|
|
48
87
|
/**
|
|
49
88
|
* The ID of the voice.
|
|
@@ -58,7 +97,7 @@ export interface Voice {
|
|
|
58
97
|
*/
|
|
59
98
|
description: string;
|
|
60
99
|
/**
|
|
61
|
-
* Whether
|
|
100
|
+
* Whether your organization owns the voice.
|
|
62
101
|
*/
|
|
63
102
|
is_owner: boolean;
|
|
64
103
|
/**
|
|
@@ -66,11 +105,8 @@ export interface Voice {
|
|
|
66
105
|
*/
|
|
67
106
|
is_public: boolean;
|
|
68
107
|
/**
|
|
69
|
-
* The language that the given voice should speak the transcript in.
|
|
70
|
-
*
|
|
71
|
-
* Options: English (en), French (fr), German (de), Spanish (es), Portuguese (pt),
|
|
72
|
-
* Chinese (zh), Japanese (ja), Hindi (hi), Italian (it), Korean (ko), Dutch (nl),
|
|
73
|
-
* Polish (pl), Russian (ru), Swedish (sv), Turkish (tr).
|
|
108
|
+
* The language that the given voice should speak the transcript in. For valid
|
|
109
|
+
* options, see [Models](/build-with-cartesia/tts-models).
|
|
74
110
|
*/
|
|
75
111
|
language: SupportedLanguage;
|
|
76
112
|
/**
|
|
@@ -82,10 +118,13 @@ export interface Voice {
|
|
|
82
118
|
*/
|
|
83
119
|
gender?: GenderPresentation | null;
|
|
84
120
|
/**
|
|
85
|
-
*
|
|
86
|
-
*
|
|
121
|
+
* A URL to download a preview audio file for this voice. Useful to avoid consuming
|
|
122
|
+
* credits when looking for the right voice. The URL requires the same
|
|
123
|
+
* Authorization header. Voice previews may be changed, moved, or deleted so you
|
|
124
|
+
* should avoid storing the URL permanently. This property will be null if there's
|
|
125
|
+
* no preview available. Only included when `expand[]` includes `preview_file_url`.
|
|
87
126
|
*/
|
|
88
|
-
|
|
127
|
+
preview_file_url?: string | null;
|
|
89
128
|
}
|
|
90
129
|
export interface VoiceMetadata {
|
|
91
130
|
/**
|
|
@@ -105,11 +144,8 @@ export interface VoiceMetadata {
|
|
|
105
144
|
*/
|
|
106
145
|
is_public: boolean;
|
|
107
146
|
/**
|
|
108
|
-
* The language that the given voice should speak the transcript in.
|
|
109
|
-
*
|
|
110
|
-
* Options: English (en), French (fr), German (de), Spanish (es), Portuguese (pt),
|
|
111
|
-
* Chinese (zh), Japanese (ja), Hindi (hi), Italian (it), Korean (ko), Dutch (nl),
|
|
112
|
-
* Polish (pl), Russian (ru), Swedish (sv), Turkish (tr).
|
|
147
|
+
* The language that the given voice should speak the transcript in. For valid
|
|
148
|
+
* options, see [Models](/build-with-cartesia/tts-models).
|
|
113
149
|
*/
|
|
114
150
|
language: SupportedLanguage;
|
|
115
151
|
/**
|
|
@@ -136,24 +172,23 @@ export interface VoiceListParams extends CursorIDPageParams {
|
|
|
136
172
|
/**
|
|
137
173
|
* Additional fields to include in the response.
|
|
138
174
|
*/
|
|
139
|
-
expand?: Array<'
|
|
175
|
+
expand?: Array<'preview_file_url'> | null;
|
|
140
176
|
/**
|
|
141
177
|
* The gender presentation of the voices to return.
|
|
142
178
|
*/
|
|
143
179
|
gender?: GenderPresentation | null;
|
|
144
180
|
/**
|
|
145
|
-
* Whether to only return voices owned
|
|
181
|
+
* Whether to only return voices owned your organization.
|
|
146
182
|
*/
|
|
147
183
|
is_owner?: boolean | null;
|
|
148
|
-
/**
|
|
149
|
-
* Whether to only return starred voices.
|
|
150
|
-
*/
|
|
151
|
-
is_starred?: boolean | null;
|
|
152
|
-
language?: string;
|
|
153
184
|
/**
|
|
154
185
|
* The number of Voices to return per page, ranging between 1 and 100.
|
|
155
186
|
*/
|
|
156
187
|
limit?: number | null;
|
|
188
|
+
/**
|
|
189
|
+
* Query string to search for voices by name, description, or Voice ID.
|
|
190
|
+
*/
|
|
191
|
+
q?: string | null;
|
|
157
192
|
}
|
|
158
193
|
export interface VoiceCloneParams {
|
|
159
194
|
/**
|
|
@@ -165,11 +200,6 @@ export interface VoiceCloneParams {
|
|
|
165
200
|
* A description for the voice.
|
|
166
201
|
*/
|
|
167
202
|
description?: string | null;
|
|
168
|
-
/**
|
|
169
|
-
* Whether to apply AI enhancements to the clip to reduce background noise. This is
|
|
170
|
-
* not recommended unless the source clip is extremely low quality.
|
|
171
|
-
*/
|
|
172
|
-
enhance?: boolean | null;
|
|
173
203
|
/**
|
|
174
204
|
* The language of the voice.
|
|
175
205
|
*/
|
|
@@ -179,6 +209,12 @@ export interface VoiceCloneParams {
|
|
|
179
209
|
*/
|
|
180
210
|
name?: string;
|
|
181
211
|
}
|
|
212
|
+
export interface VoiceGetParams {
|
|
213
|
+
/**
|
|
214
|
+
* Additional fields to include in the response.
|
|
215
|
+
*/
|
|
216
|
+
expand?: Array<'preview_file_url'> | null;
|
|
217
|
+
}
|
|
182
218
|
export interface VoiceLocalizeParams {
|
|
183
219
|
/**
|
|
184
220
|
* The description of the new localized voice.
|
|
@@ -208,6 +244,6 @@ export interface VoiceLocalizeParams {
|
|
|
208
244
|
dialect?: 'au' | 'in' | 'so' | 'uk' | 'us' | 'mx' | 'pe' | 'br' | 'eu' | 'ca' | null;
|
|
209
245
|
}
|
|
210
246
|
export declare namespace Voices {
|
|
211
|
-
export { type GenderPresentation as GenderPresentation, type SupportedLanguage as SupportedLanguage, type Voice as Voice, type VoiceMetadata as VoiceMetadata, type VoicesCursorIDPage as VoicesCursorIDPage, type VoiceUpdateParams as VoiceUpdateParams, type VoiceListParams as VoiceListParams, type VoiceCloneParams as VoiceCloneParams, type VoiceLocalizeParams as VoiceLocalizeParams, };
|
|
247
|
+
export { type GenderPresentation as GenderPresentation, type SupportedLanguage as SupportedLanguage, type Voice as Voice, type VoiceMetadata as VoiceMetadata, type VoicesCursorIDPage as VoicesCursorIDPage, type VoiceUpdateParams as VoiceUpdateParams, type VoiceListParams as VoiceListParams, type VoiceCloneParams as VoiceCloneParams, type VoiceGetParams as VoiceGetParams, type VoiceLocalizeParams as VoiceLocalizeParams, };
|
|
212
248
|
}
|
|
213
249
|
//# sourceMappingURL=voices.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"voices.d.ts","sourceRoot":"","sources":["../src/resources/voices.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,YAAY,EAAE,KAAK,kBAAkB,EAAE,WAAW,EAAE;OACtD,EAAE,KAAK,UAAU,EAAE;OAEnB,EAAE,cAAc,EAAE;AAIzB,qBAAa,MAAO,SAAQ,WAAW;IACrC
|
|
1
|
+
{"version":3,"file":"voices.d.ts","sourceRoot":"","sources":["../src/resources/voices.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,YAAY,EAAE,KAAK,kBAAkB,EAAE,WAAW,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AAuB,EAAE,MAAM,GAAG,QAAQ,CAAC;IAE3C;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,OAAO,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;CACtF;AAED,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,OAAO,EACL,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,KAAK,IAAI,KAAK,EACnB,KAAK,aAAa,IAAI,aAAa,EACnC,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;CACH"}
|
package/resources/voices.js
CHANGED
|
@@ -12,18 +12,39 @@ class Voices extends resource_1.APIResource {
|
|
|
12
12
|
* Update the name, description, and gender of a voice. To set the gender back to
|
|
13
13
|
* the default, set the gender to `null`. If gender is not specified, the gender
|
|
14
14
|
* will not be updated.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* const voice = await client.voices.update('id', {
|
|
19
|
+
* description: 'description',
|
|
20
|
+
* name: 'name',
|
|
21
|
+
* });
|
|
22
|
+
* ```
|
|
15
23
|
*/
|
|
16
24
|
update(id, body, options) {
|
|
17
25
|
return this._client.patch((0, path_1.path) `/voices/${id}`, { body, ...options });
|
|
18
26
|
}
|
|
19
27
|
/**
|
|
20
28
|
* List Voices
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```ts
|
|
32
|
+
* // Automatically fetches more pages as needed.
|
|
33
|
+
* for await (const voice of client.voices.list()) {
|
|
34
|
+
* // ...
|
|
35
|
+
* }
|
|
36
|
+
* ```
|
|
21
37
|
*/
|
|
22
38
|
list(query = {}, options) {
|
|
23
|
-
return this._client.getAPIList('/voices
|
|
39
|
+
return this._client.getAPIList('/voices', (pagination_1.CursorIDPage), { query, ...options });
|
|
24
40
|
}
|
|
25
41
|
/**
|
|
26
42
|
* Delete Voice
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```ts
|
|
46
|
+
* await client.voices.delete('id');
|
|
47
|
+
* ```
|
|
27
48
|
*/
|
|
28
49
|
delete(id, options) {
|
|
29
50
|
return this._client.delete((0, path_1.path) `/voices/${id}`, {
|
|
@@ -35,19 +56,40 @@ class Voices extends resource_1.APIResource {
|
|
|
35
56
|
* Clone a high similarity voice from an audio clip. Clones are more similar to the
|
|
36
57
|
* source clip, but may reproduce background noise. For these, use an audio clip
|
|
37
58
|
* about 5 seconds long.
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* ```ts
|
|
62
|
+
* const voiceMetadata = await client.voices.clone();
|
|
63
|
+
* ```
|
|
38
64
|
*/
|
|
39
65
|
clone(body, options) {
|
|
40
66
|
return this._client.post('/voices/clone', (0, uploads_1.multipartFormRequestOptions)({ body, ...options }, this._client));
|
|
41
67
|
}
|
|
42
68
|
/**
|
|
43
69
|
* Get Voice
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* ```ts
|
|
73
|
+
* const voice = await client.voices.get('id');
|
|
74
|
+
* ```
|
|
44
75
|
*/
|
|
45
|
-
get(id, options) {
|
|
46
|
-
return this._client.get((0, path_1.path) `/voices/${id}`, options);
|
|
76
|
+
get(id, query = {}, options) {
|
|
77
|
+
return this._client.get((0, path_1.path) `/voices/${id}`, { query, ...options });
|
|
47
78
|
}
|
|
48
79
|
/**
|
|
49
80
|
* Create a new voice from an existing voice localized to a new language and
|
|
50
81
|
* dialect.
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* ```ts
|
|
85
|
+
* const voiceMetadata = await client.voices.localize({
|
|
86
|
+
* description: 'description',
|
|
87
|
+
* language: 'en',
|
|
88
|
+
* name: 'name',
|
|
89
|
+
* original_speaker_gender: 'male',
|
|
90
|
+
* voice_id: 'voice_id',
|
|
91
|
+
* });
|
|
92
|
+
* ```
|
|
51
93
|
*/
|
|
52
94
|
localize(body, options) {
|
|
53
95
|
return this._client.post('/voices/localize', { body, ...options });
|
package/resources/voices.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"voices.js","sourceRoot":"","sources":["../src/resources/voices.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAE/C,sDAAwF;AAExF,oDAAmD;AAEnD,oDAAkE;AAClE,oDAA8C;AAE9C,MAAa,MAAO,SAAQ,sBAAW;IACrC
|
|
1
|
+
{"version":3,"file":"voices.js","sourceRoot":"","sources":["../src/resources/voices.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAE/C,sDAAwF;AAExF,oDAAmD;AAEnD,oDAAkE;AAClE,oDAA8C;AAE9C,MAAa,MAAO,SAAQ,sBAAW;IACrC;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,EAAU,EAAE,IAAuB,EAAE,OAAwB;QAClE,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAA,WAAI,EAAA,WAAW,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACvE,CAAC;IAED;;;;;;;;;;OAUG;IACH,IAAI,CACF,QAA4C,EAAE,EAC9C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,SAAS,EAAE,CAAA,yBAAmB,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACxF,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,EAAU,EAAE,OAAwB;QACzC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,WAAW,EAAE,EAAE,EAAE;YAC9C,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;OASG;IACH,KAAK,CAAC,IAAsB,EAAE,OAAwB;QACpD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CACtB,eAAe,EACf,IAAA,qCAA2B,EAAC,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,CAChE,CAAC;IACJ,CAAC;IAED;;;;;;;OAOG;IACH,GAAG,CACD,EAAU,EACV,QAA2C,EAAE,EAC7C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,WAAW,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACtE,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,IAAyB,EAAE,OAAwB;QAC1D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,kBAAkB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrE,CAAC;CACF;AAtGD,wBAsGC"}
|
package/resources/voices.mjs
CHANGED
|
@@ -9,18 +9,39 @@ export class Voices extends APIResource {
|
|
|
9
9
|
* Update the name, description, and gender of a voice. To set the gender back to
|
|
10
10
|
* the default, set the gender to `null`. If gender is not specified, the gender
|
|
11
11
|
* will not be updated.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const voice = await client.voices.update('id', {
|
|
16
|
+
* description: 'description',
|
|
17
|
+
* name: 'name',
|
|
18
|
+
* });
|
|
19
|
+
* ```
|
|
12
20
|
*/
|
|
13
21
|
update(id, body, options) {
|
|
14
22
|
return this._client.patch(path `/voices/${id}`, { body, ...options });
|
|
15
23
|
}
|
|
16
24
|
/**
|
|
17
25
|
* List Voices
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* // Automatically fetches more pages as needed.
|
|
30
|
+
* for await (const voice of client.voices.list()) {
|
|
31
|
+
* // ...
|
|
32
|
+
* }
|
|
33
|
+
* ```
|
|
18
34
|
*/
|
|
19
35
|
list(query = {}, options) {
|
|
20
|
-
return this._client.getAPIList('/voices
|
|
36
|
+
return this._client.getAPIList('/voices', (CursorIDPage), { query, ...options });
|
|
21
37
|
}
|
|
22
38
|
/**
|
|
23
39
|
* Delete Voice
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```ts
|
|
43
|
+
* await client.voices.delete('id');
|
|
44
|
+
* ```
|
|
24
45
|
*/
|
|
25
46
|
delete(id, options) {
|
|
26
47
|
return this._client.delete(path `/voices/${id}`, {
|
|
@@ -32,19 +53,40 @@ export class Voices extends APIResource {
|
|
|
32
53
|
* Clone a high similarity voice from an audio clip. Clones are more similar to the
|
|
33
54
|
* source clip, but may reproduce background noise. For these, use an audio clip
|
|
34
55
|
* about 5 seconds long.
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```ts
|
|
59
|
+
* const voiceMetadata = await client.voices.clone();
|
|
60
|
+
* ```
|
|
35
61
|
*/
|
|
36
62
|
clone(body, options) {
|
|
37
63
|
return this._client.post('/voices/clone', multipartFormRequestOptions({ body, ...options }, this._client));
|
|
38
64
|
}
|
|
39
65
|
/**
|
|
40
66
|
* Get Voice
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```ts
|
|
70
|
+
* const voice = await client.voices.get('id');
|
|
71
|
+
* ```
|
|
41
72
|
*/
|
|
42
|
-
get(id, options) {
|
|
43
|
-
return this._client.get(path `/voices/${id}`, options);
|
|
73
|
+
get(id, query = {}, options) {
|
|
74
|
+
return this._client.get(path `/voices/${id}`, { query, ...options });
|
|
44
75
|
}
|
|
45
76
|
/**
|
|
46
77
|
* Create a new voice from an existing voice localized to a new language and
|
|
47
78
|
* dialect.
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* ```ts
|
|
82
|
+
* const voiceMetadata = await client.voices.localize({
|
|
83
|
+
* description: 'description',
|
|
84
|
+
* language: 'en',
|
|
85
|
+
* name: 'name',
|
|
86
|
+
* original_speaker_gender: 'male',
|
|
87
|
+
* voice_id: 'voice_id',
|
|
88
|
+
* });
|
|
89
|
+
* ```
|
|
48
90
|
*/
|
|
49
91
|
localize(body, options) {
|
|
50
92
|
return this._client.post('/voices/localize', { body, ...options });
|
package/resources/voices.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"voices.mjs","sourceRoot":"","sources":["../src/resources/voices.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAEf,EAAE,YAAY,EAAwC;OAEtD,EAAE,YAAY,EAAE;OAEhB,EAAE,2BAA2B,EAAE;OAC/B,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,MAAO,SAAQ,WAAW;IACrC
|
|
1
|
+
{"version":3,"file":"voices.mjs","sourceRoot":"","sources":["../src/resources/voices.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAEf,EAAE,YAAY,EAAwC;OAEtD,EAAE,YAAY,EAAE;OAEhB,EAAE,2BAA2B,EAAE;OAC/B,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,MAAO,SAAQ,WAAW;IACrC;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,EAAU,EAAE,IAAuB,EAAE,OAAwB;QAClE,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAA,WAAW,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,E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