@ai-matrx/media 0.15.3 → 0.15.5

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/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 client = new Cartesia({ token });
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
  });