@ai-matrx/media 0.15.4 → 0.15.6
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 +8 -2
- package/dist/files/engine/cache/idb-store.d.ts +2 -1
- package/dist/files/engine/cache/idb-store.js +2 -2
- package/dist/files/engine/cache/idb-store.js.map +1 -1
- package/dist/speech.cjs +13 -3
- package/dist/speech.cjs.map +1 -1
- package/dist/speech.js +2 -2
- package/dist/speech.js.map +1 -1
- package/package.json +3 -3
package/dist/speech.js
CHANGED
|
@@ -616,7 +616,6 @@ var init_tts_config = __esm({
|
|
|
616
616
|
});
|
|
617
617
|
|
|
618
618
|
// src/speech/cartesia-socket.ts
|
|
619
|
-
import { Cartesia } from "@cartesia/cartesia-js/client";
|
|
620
619
|
function isCartesiaAuthError(error) {
|
|
621
620
|
const message = error instanceof Error ? error.message : String(error ?? "");
|
|
622
621
|
return /\b(401|403)\b|unauthorized|forbidden|invalid.*token|expired.*token|authentication/i.test(message);
|
|
@@ -642,7 +641,8 @@ function toNativeVoice(voice) {
|
|
|
642
641
|
return { id: voice.id };
|
|
643
642
|
}
|
|
644
643
|
async function buildConnectedSocket(token, options) {
|
|
645
|
-
const
|
|
644
|
+
const { Cartesia: CartesiaClient } = await import("@cartesia/cartesia-js/client");
|
|
645
|
+
const client = new CartesiaClient({ token });
|
|
646
646
|
const native = await client.tts.websocket({
|
|
647
647
|
headers: { "Cartesia-Version": CARTESIA_API_VERSION }
|
|
648
648
|
});
|