@cartesia/cartesia-js 3.0.0-b5 → 3.0.0-b6
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 +4 -0
- package/backcompat/index.d.mts +11 -31
- package/backcompat/index.d.mts.map +1 -1
- package/backcompat/index.d.ts +11 -31
- package/backcompat/index.d.ts.map +1 -1
- package/backcompat/index.js +22 -252
- package/backcompat/index.js.map +1 -1
- package/backcompat/index.mjs +21 -251
- package/backcompat/index.mjs.map +1 -1
- package/backcompat/tts-wrapper.d.mts +66 -0
- package/backcompat/tts-wrapper.d.mts.map +1 -0
- package/backcompat/tts-wrapper.d.ts +66 -0
- package/backcompat/tts-wrapper.d.ts.map +1 -0
- package/backcompat/tts-wrapper.js +260 -0
- package/backcompat/tts-wrapper.js.map +1 -0
- package/backcompat/tts-wrapper.mjs +254 -0
- package/backcompat/tts-wrapper.mjs.map +1 -0
- package/backcompat/types.d.mts +18 -0
- package/backcompat/types.d.mts.map +1 -0
- package/backcompat/types.d.ts +18 -0
- package/backcompat/types.d.ts.map +1 -0
- package/backcompat/types.js +3 -0
- package/backcompat/types.js.map +1 -0
- package/backcompat/types.mjs +2 -0
- package/backcompat/types.mjs.map +1 -0
- package/backcompat/voice-changer-wrapper.d.mts +17 -0
- package/backcompat/voice-changer-wrapper.d.mts.map +1 -0
- package/backcompat/voice-changer-wrapper.d.ts +17 -0
- package/backcompat/voice-changer-wrapper.d.ts.map +1 -0
- package/backcompat/voice-changer-wrapper.js +46 -0
- package/backcompat/voice-changer-wrapper.js.map +1 -0
- package/backcompat/voice-changer-wrapper.mjs +42 -0
- package/backcompat/voice-changer-wrapper.mjs.map +1 -0
- package/backcompat/voices-wrapper.d.mts +32 -0
- package/backcompat/voices-wrapper.d.mts.map +1 -0
- package/backcompat/voices-wrapper.d.ts +32 -0
- package/backcompat/voices-wrapper.d.ts.map +1 -0
- package/backcompat/voices-wrapper.js +77 -0
- package/backcompat/voices-wrapper.js.map +1 -0
- package/backcompat/voices-wrapper.mjs +73 -0
- package/backcompat/voices-wrapper.mjs.map +1 -0
- package/package.json +1 -1
- package/src/backcompat/index.ts +27 -289
- package/src/backcompat/tts-wrapper.ts +324 -0
- package/src/backcompat/types.ts +19 -0
- package/src/backcompat/voice-changer-wrapper.ts +67 -0
- package/src/backcompat/voices-wrapper.ts +158 -0
- 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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 3.0.0-b6 (2026-01-09)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v3.0.0-b5...v3.0.0-b6](https://github.com/cartesia-ai/cartesia-js-internal/compare/v3.0.0-b5...v3.0.0-b6)
|
|
6
|
+
|
|
3
7
|
## 3.0.0-b5 (2026-01-07)
|
|
4
8
|
|
|
5
9
|
Full Changelog: [v3.0.0-b4...v3.0.0-b5](https://github.com/cartesia-ai/cartesia-js-internal/compare/v3.0.0-b4...v3.0.0-b5)
|
package/backcompat/index.d.mts
CHANGED
|
@@ -1,36 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
isDone: boolean;
|
|
6
|
-
push(data: Buffer): void;
|
|
7
|
-
markDone(): void;
|
|
8
|
-
read(outBuffer: Float32Array): Promise<number>;
|
|
9
|
-
}
|
|
10
|
-
declare class WebSocketWrapper {
|
|
11
|
-
private client;
|
|
12
|
-
private config;
|
|
13
|
-
private socket;
|
|
14
|
-
private sources;
|
|
15
|
-
private defaultSource;
|
|
16
|
-
constructor(client: Cartesia, config: any);
|
|
17
|
-
connect(): Promise<void>;
|
|
18
|
-
private handleMessage;
|
|
19
|
-
send(request: any): Promise<{
|
|
20
|
-
source: AudioSource;
|
|
21
|
-
}>;
|
|
22
|
-
disconnect(): void;
|
|
23
|
-
}
|
|
24
|
-
declare class TTSWrapper {
|
|
25
|
-
private client;
|
|
26
|
-
constructor(client: Cartesia);
|
|
27
|
-
websocket(config: any): WebSocketWrapper;
|
|
28
|
-
bytes(request: any, requestOptions?: any): Promise<any>;
|
|
29
|
-
}
|
|
1
|
+
import { TTSWrapper } from "./tts-wrapper.mjs";
|
|
2
|
+
import { VoicesWrapper } from "./voices-wrapper.mjs";
|
|
3
|
+
import { VoiceChangerWrapper } from "./voice-changer-wrapper.mjs";
|
|
4
|
+
import type { CartesiaClientOptions } from "./types.mjs";
|
|
30
5
|
export declare class CartesiaClient {
|
|
31
6
|
private client;
|
|
32
7
|
tts: TTSWrapper;
|
|
33
|
-
|
|
8
|
+
voices: VoicesWrapper;
|
|
9
|
+
voiceChanger: VoiceChangerWrapper;
|
|
10
|
+
constructor(options?: CartesiaClientOptions);
|
|
34
11
|
}
|
|
35
|
-
export
|
|
12
|
+
export * from "./tts-wrapper.mjs";
|
|
13
|
+
export * from "./voices-wrapper.mjs";
|
|
14
|
+
export * from "./voice-changer-wrapper.mjs";
|
|
15
|
+
export * from "./types.mjs";
|
|
36
16
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/backcompat/index.ts"],"names":[],"mappings":"OACO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/backcompat/index.ts"],"names":[],"mappings":"OACO,EAAE,UAAU,EAAE;OACd,EAAE,aAAa,EAAE;OACjB,EAAE,mBAAmB,EAAE;OACvB,KAAK,EAAE,qBAAqB,EAAE;AAMrC,qBAAa,cAAc;IAC1B,OAAO,CAAC,MAAM,CAAW;IAClB,GAAG,EAAE,UAAU,CAAC;IAChB,MAAM,EAAE,aAAa,CAAC;IACtB,YAAY,EAAE,mBAAmB,CAAC;gBAE7B,OAAO,GAAE,qBAA0B;CAkB/C"}
|
package/backcompat/index.d.ts
CHANGED
|
@@ -1,36 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
isDone: boolean;
|
|
6
|
-
push(data: Buffer): void;
|
|
7
|
-
markDone(): void;
|
|
8
|
-
read(outBuffer: Float32Array): Promise<number>;
|
|
9
|
-
}
|
|
10
|
-
declare class WebSocketWrapper {
|
|
11
|
-
private client;
|
|
12
|
-
private config;
|
|
13
|
-
private socket;
|
|
14
|
-
private sources;
|
|
15
|
-
private defaultSource;
|
|
16
|
-
constructor(client: Cartesia, config: any);
|
|
17
|
-
connect(): Promise<void>;
|
|
18
|
-
private handleMessage;
|
|
19
|
-
send(request: any): Promise<{
|
|
20
|
-
source: AudioSource;
|
|
21
|
-
}>;
|
|
22
|
-
disconnect(): void;
|
|
23
|
-
}
|
|
24
|
-
declare class TTSWrapper {
|
|
25
|
-
private client;
|
|
26
|
-
constructor(client: Cartesia);
|
|
27
|
-
websocket(config: any): WebSocketWrapper;
|
|
28
|
-
bytes(request: any, requestOptions?: any): Promise<any>;
|
|
29
|
-
}
|
|
1
|
+
import { TTSWrapper } from "./tts-wrapper.js";
|
|
2
|
+
import { VoicesWrapper } from "./voices-wrapper.js";
|
|
3
|
+
import { VoiceChangerWrapper } from "./voice-changer-wrapper.js";
|
|
4
|
+
import type { CartesiaClientOptions } from "./types.js";
|
|
30
5
|
export declare class CartesiaClient {
|
|
31
6
|
private client;
|
|
32
7
|
tts: TTSWrapper;
|
|
33
|
-
|
|
8
|
+
voices: VoicesWrapper;
|
|
9
|
+
voiceChanger: VoiceChangerWrapper;
|
|
10
|
+
constructor(options?: CartesiaClientOptions);
|
|
34
11
|
}
|
|
35
|
-
export
|
|
12
|
+
export * from "./tts-wrapper.js";
|
|
13
|
+
export * from "./voices-wrapper.js";
|
|
14
|
+
export * from "./voice-changer-wrapper.js";
|
|
15
|
+
export * from "./types.js";
|
|
36
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/backcompat/index.ts"],"names":[],"mappings":"OACO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/backcompat/index.ts"],"names":[],"mappings":"OACO,EAAE,UAAU,EAAE;OACd,EAAE,aAAa,EAAE;OACjB,EAAE,mBAAmB,EAAE;OACvB,KAAK,EAAE,qBAAqB,EAAE;AAMrC,qBAAa,cAAc;IAC1B,OAAO,CAAC,MAAM,CAAW;IAClB,GAAG,EAAE,UAAU,CAAC;IAChB,MAAM,EAAE,aAAa,CAAC;IACtB,YAAY,EAAE,mBAAmB,CAAC;gBAE7B,OAAO,GAAE,qBAA0B;CAkB/C"}
|
package/backcompat/index.js
CHANGED
|
@@ -2,265 +2,35 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CartesiaClient = void 0;
|
|
4
4
|
const tslib_1 = require("../internal/tslib.js");
|
|
5
|
-
const ws_1 = tslib_1.__importDefault(require("ws"));
|
|
6
5
|
const client_1 = require("../client.js");
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
this.waiter = null;
|
|
11
|
-
this.isDone = false;
|
|
12
|
-
}
|
|
13
|
-
push(data) {
|
|
14
|
-
this.buffers.push(data);
|
|
15
|
-
if (this.waiter) {
|
|
16
|
-
this.waiter();
|
|
17
|
-
this.waiter = null;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
markDone() {
|
|
21
|
-
this.isDone = true;
|
|
22
|
-
if (this.waiter) {
|
|
23
|
-
this.waiter();
|
|
24
|
-
this.waiter = null;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
async read(outBuffer) {
|
|
28
|
-
if (this.buffers.length === 0 && !this.isDone) {
|
|
29
|
-
await new Promise((resolve) => { this.waiter = resolve; });
|
|
30
|
-
}
|
|
31
|
-
if (this.buffers.length === 0 && this.isDone) {
|
|
32
|
-
return 0;
|
|
33
|
-
}
|
|
34
|
-
let totalFloatsRead = 0;
|
|
35
|
-
let outOffset = 0;
|
|
36
|
-
const maxFloats = outBuffer.length;
|
|
37
|
-
while (this.buffers.length > 0 && totalFloatsRead < maxFloats) {
|
|
38
|
-
const buf = this.buffers[0]; // ts not smart enough to check loop condition
|
|
39
|
-
const floatsInBuf = buf.length / 4;
|
|
40
|
-
const floatsNeeded = maxFloats - totalFloatsRead;
|
|
41
|
-
const floatsToCopy = Math.min(floatsInBuf, floatsNeeded);
|
|
42
|
-
const bytesToCopy = floatsToCopy * 4;
|
|
43
|
-
// Copy to outBuffer.
|
|
44
|
-
// Create a view on the buffer to read floats.
|
|
45
|
-
// We need to ensure byteOffset is a multiple of 4.
|
|
46
|
-
// If not, we must copy the buffer to a new one.
|
|
47
|
-
let srcFloats;
|
|
48
|
-
if (buf.byteOffset % 4 === 0) {
|
|
49
|
-
srcFloats = new Float32Array(buf.buffer, buf.byteOffset, floatsInBuf);
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
const alignedBuf = new Uint8Array(buf);
|
|
53
|
-
srcFloats = new Float32Array(alignedBuf.buffer, alignedBuf.byteOffset, floatsInBuf);
|
|
54
|
-
}
|
|
55
|
-
outBuffer.set(srcFloats.subarray(0, floatsToCopy), outOffset);
|
|
56
|
-
totalFloatsRead += floatsToCopy;
|
|
57
|
-
outOffset += floatsToCopy;
|
|
58
|
-
if (floatsToCopy < floatsInBuf) {
|
|
59
|
-
// We didn't use the whole buffer. Update it.
|
|
60
|
-
this.buffers[0] = buf.subarray(bytesToCopy);
|
|
61
|
-
}
|
|
62
|
-
else {
|
|
63
|
-
// We used the whole buffer. Remove it.
|
|
64
|
-
this.buffers.shift();
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
return totalFloatsRead;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
class WebSocketWrapper {
|
|
71
|
-
constructor(client, config) {
|
|
72
|
-
this.socket = null;
|
|
73
|
-
this.sources = new Map();
|
|
74
|
-
// Fallback source for messages without context_id or if we just want to capture everything (legacy behavior?)
|
|
75
|
-
// The original test didn't use context_id explicitly in send() but expected a response source.
|
|
76
|
-
// We'll map context_id to source.
|
|
77
|
-
this.defaultSource = null;
|
|
78
|
-
this.client = client;
|
|
79
|
-
this.config = config;
|
|
80
|
-
}
|
|
81
|
-
async connect() {
|
|
82
|
-
const baseURL = this.client.baseURL;
|
|
83
|
-
// Construct WebSocket URL
|
|
84
|
-
// baseURL is like https://api.cartesia.ai
|
|
85
|
-
let urlStr = baseURL.replace(/^http/, "ws");
|
|
86
|
-
if (!urlStr.includes("/tts/websocket")) {
|
|
87
|
-
if (urlStr.endsWith("/")) {
|
|
88
|
-
urlStr += "tts/websocket";
|
|
89
|
-
}
|
|
90
|
-
else {
|
|
91
|
-
urlStr += "/tts/websocket";
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
const url = new URL(urlStr);
|
|
95
|
-
const headers = {
|
|
96
|
-
"cartesia-version": "2025-04-16",
|
|
97
|
-
};
|
|
98
|
-
if (this.client.apiKey) {
|
|
99
|
-
headers["Authorization"] = `Bearer ${this.client.apiKey}`;
|
|
100
|
-
}
|
|
101
|
-
this.socket = new ws_1.default(url.toString(), {
|
|
102
|
-
headers: headers,
|
|
103
|
-
});
|
|
104
|
-
return new Promise((resolve, reject) => {
|
|
105
|
-
this.socket.on("open", () => {
|
|
106
|
-
console.log("WebSocket connected.");
|
|
107
|
-
resolve();
|
|
108
|
-
});
|
|
109
|
-
this.socket.on("error", (err) => {
|
|
110
|
-
console.error("WebSocket error:", err);
|
|
111
|
-
reject(err);
|
|
112
|
-
});
|
|
113
|
-
this.socket.on("message", (data) => {
|
|
114
|
-
this.handleMessage(data);
|
|
115
|
-
});
|
|
116
|
-
this.socket.on("close", () => {
|
|
117
|
-
console.log("WebSocket closed.");
|
|
118
|
-
this.sources.forEach((s) => { s.markDone(); });
|
|
119
|
-
if (this.defaultSource)
|
|
120
|
-
this.defaultSource.markDone();
|
|
121
|
-
});
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
handleMessage(data) {
|
|
125
|
-
try {
|
|
126
|
-
const str = data.toString();
|
|
127
|
-
const msg = JSON.parse(str);
|
|
128
|
-
const contextId = msg.context_id;
|
|
129
|
-
let source = contextId ? this.sources.get(contextId) : this.defaultSource;
|
|
130
|
-
// If we received a message for a context we don't know about, and we have a default source, use it
|
|
131
|
-
if (!source && this.defaultSource) {
|
|
132
|
-
source = this.defaultSource;
|
|
133
|
-
}
|
|
134
|
-
if (msg.type === "chunk" && msg.data) {
|
|
135
|
-
const audioData = Buffer.from(msg.data, "base64");
|
|
136
|
-
if (source)
|
|
137
|
-
source.push(audioData);
|
|
138
|
-
}
|
|
139
|
-
else if (msg.type === "done") {
|
|
140
|
-
if (source)
|
|
141
|
-
source.markDone();
|
|
142
|
-
}
|
|
143
|
-
else if (msg.type === "error") {
|
|
144
|
-
console.error("Server error:", msg);
|
|
145
|
-
if (source)
|
|
146
|
-
source.markDone(); // Fail the stream?
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
catch (e) {
|
|
150
|
-
console.error("Error parsing message:", e);
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
async send(request) {
|
|
154
|
-
if (!this.socket) {
|
|
155
|
-
throw new Error("WebSocket not connected");
|
|
156
|
-
}
|
|
157
|
-
// Ensure request has a context_id so we can route the response
|
|
158
|
-
if (!request.context_id) {
|
|
159
|
-
request.context_id = uuidv4();
|
|
160
|
-
}
|
|
161
|
-
const source = new AudioSource();
|
|
162
|
-
this.sources.set(request.context_id, source);
|
|
163
|
-
// Also set as default source if none exists, for compatibility with simple tests
|
|
164
|
-
if (!this.defaultSource) {
|
|
165
|
-
this.defaultSource = source;
|
|
166
|
-
}
|
|
167
|
-
// Add output format from config if not present
|
|
168
|
-
if (!request.output_format && this.config) {
|
|
169
|
-
request.output_format = {
|
|
170
|
-
container: this.config.container,
|
|
171
|
-
encoding: this.config.encoding,
|
|
172
|
-
sample_rate: this.config.sampleRate,
|
|
173
|
-
};
|
|
174
|
-
}
|
|
175
|
-
// Fix camelCase to snake_case for output_format if needed
|
|
176
|
-
// The new API expects snake_case keys in JSON usually, but let's check.
|
|
177
|
-
// The GenerationRequest interface has `output_format`.
|
|
178
|
-
// The config passed to .websocket() uses `sampleRate`.
|
|
179
|
-
// We might need to map it.
|
|
180
|
-
if (request.output_format) {
|
|
181
|
-
// Ensure sample_rate is set (mapping from sampleRate)
|
|
182
|
-
if (request.output_format.sampleRate && !request.output_format.sample_rate) {
|
|
183
|
-
request.output_format.sample_rate = request.output_format.sampleRate;
|
|
184
|
-
delete request.output_format.sampleRate;
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
// Map camelCase request fields to snake_case if necessary?
|
|
188
|
-
// The old test uses `modelId`, `generationConfig`.
|
|
189
|
-
// The new API expects `model_id`, `generation_config`.
|
|
190
|
-
const payload = {
|
|
191
|
-
...request,
|
|
192
|
-
model_id: request.modelId || request.model_id,
|
|
193
|
-
generation_config: request.generationConfig || request.generation_config,
|
|
194
|
-
context_id: request.context_id,
|
|
195
|
-
};
|
|
196
|
-
// Remove camelCase keys if they persist?
|
|
197
|
-
// JSON.stringify handles it, but we should clean up if we want to be strict.
|
|
198
|
-
// Also `voice` object. Old test: `voice: { mode: 'id', id: ... }`. New API: same.
|
|
199
|
-
this.socket.send(JSON.stringify(payload));
|
|
200
|
-
return {
|
|
201
|
-
source: source
|
|
202
|
-
};
|
|
203
|
-
}
|
|
204
|
-
disconnect() {
|
|
205
|
-
if (this.socket) {
|
|
206
|
-
this.socket.close();
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
class TTSWrapper {
|
|
211
|
-
constructor(client) {
|
|
212
|
-
this.client = client;
|
|
213
|
-
}
|
|
214
|
-
websocket(config) {
|
|
215
|
-
return new WebSocketWrapper(this.client, config);
|
|
216
|
-
}
|
|
217
|
-
async bytes(request, requestOptions) {
|
|
218
|
-
const params = {
|
|
219
|
-
model_id: request.modelId,
|
|
220
|
-
transcript: request.transcript,
|
|
221
|
-
voice: request.voice,
|
|
222
|
-
generation_config: request.generationConfig,
|
|
223
|
-
context_id: request.contextId,
|
|
224
|
-
};
|
|
225
|
-
if (request.outputFormat) {
|
|
226
|
-
params.output_format = {
|
|
227
|
-
...request.outputFormat,
|
|
228
|
-
sample_rate: request.outputFormat.sampleRate,
|
|
229
|
-
bit_rate: request.outputFormat.bitRate,
|
|
230
|
-
};
|
|
231
|
-
// Remove camelCase keys
|
|
232
|
-
delete params.output_format.sampleRate;
|
|
233
|
-
delete params.output_format.bitRate;
|
|
234
|
-
}
|
|
235
|
-
const options = {};
|
|
236
|
-
if (requestOptions) {
|
|
237
|
-
if (requestOptions.timeoutInSeconds) {
|
|
238
|
-
options.timeout = requestOptions.timeoutInSeconds * 1000;
|
|
239
|
-
}
|
|
240
|
-
options.maxRetries = requestOptions.maxRetries;
|
|
241
|
-
options.headers = requestOptions.headers;
|
|
242
|
-
options.signal = requestOptions.abortSignal;
|
|
243
|
-
}
|
|
244
|
-
// @ts-ignore
|
|
245
|
-
return this.client.tts.synthesizeBytes(params, options);
|
|
246
|
-
}
|
|
247
|
-
}
|
|
6
|
+
const tts_wrapper_1 = require("./tts-wrapper.js");
|
|
7
|
+
const voices_wrapper_1 = require("./voices-wrapper.js");
|
|
8
|
+
const voice_changer_wrapper_1 = require("./voice-changer-wrapper.js");
|
|
248
9
|
/*
|
|
249
10
|
* CartesiaClient - deprecated backcompat class.
|
|
250
11
|
* New code should use Cartesia class directly instead.
|
|
251
12
|
*/
|
|
252
13
|
class CartesiaClient {
|
|
253
|
-
constructor(options) {
|
|
254
|
-
|
|
255
|
-
|
|
14
|
+
constructor(options = {}) {
|
|
15
|
+
const newOptions = {};
|
|
16
|
+
if (options.apiKey) {
|
|
17
|
+
newOptions.apiKey = options.apiKey;
|
|
18
|
+
}
|
|
19
|
+
if (options.baseUrl) {
|
|
20
|
+
newOptions.baseURL = options.baseUrl;
|
|
21
|
+
}
|
|
22
|
+
else if (options.environment) {
|
|
23
|
+
newOptions.baseURL = options.environment;
|
|
24
|
+
}
|
|
25
|
+
this.client = new client_1.Cartesia(newOptions);
|
|
26
|
+
this.tts = new tts_wrapper_1.TTSWrapper(this.client);
|
|
27
|
+
this.voices = new voices_wrapper_1.VoicesWrapper(this.client);
|
|
28
|
+
this.voiceChanger = new voice_changer_wrapper_1.VoiceChangerWrapper(this.client);
|
|
256
29
|
}
|
|
257
30
|
}
|
|
258
31
|
exports.CartesiaClient = CartesiaClient;
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
return v.toString(16);
|
|
264
|
-
});
|
|
265
|
-
}
|
|
32
|
+
tslib_1.__exportStar(require("./tts-wrapper.js"), exports);
|
|
33
|
+
tslib_1.__exportStar(require("./voices-wrapper.js"), exports);
|
|
34
|
+
tslib_1.__exportStar(require("./voice-changer-wrapper.js"), exports);
|
|
35
|
+
tslib_1.__exportStar(require("./types.js"), exports);
|
|
266
36
|
//# sourceMappingURL=index.js.map
|
package/backcompat/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/backcompat/index.ts"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/backcompat/index.ts"],"names":[],"mappings":";;;;AAAA,yCAAyD;AACzD,kDAA2C;AAC3C,wDAAiD;AACjD,sEAA8D;AAG9D;;;GAGG;AACH,MAAa,cAAc;IAM1B,YAAY,UAAiC,EAAE;QAC9C,MAAM,UAAU,GAAkB,EAAE,CAAC;QAErC,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;YACpB,UAAU,CAAC,MAAM,GAAG,OAAO,CAAC,MAAa,CAAC;QAC3C,CAAC;QAED,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;YACrB,UAAU,CAAC,OAAO,GAAG,OAAO,CAAC,OAAc,CAAC;QAC7C,CAAC;aAAM,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;YAChC,UAAU,CAAC,OAAO,GAAG,OAAO,CAAC,WAAkB,CAAC;QACjD,CAAC;QAED,IAAI,CAAC,MAAM,GAAG,IAAI,iBAAQ,CAAC,UAAU,CAAC,CAAC;QACvC,IAAI,CAAC,GAAG,GAAG,IAAI,wBAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACvC,IAAI,CAAC,MAAM,GAAG,IAAI,8BAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC7C,IAAI,CAAC,YAAY,GAAG,IAAI,2CAAmB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC1D,CAAC;CACD;AAxBD,wCAwBC;AAED,2DAA8B;AAC9B,8DAAiC;AACjC,qEAAwC;AACxC,qDAAwB"}
|