Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't use the React hook in Expo #18

Open
jackguo709 opened this issue Nov 21, 2024 · 3 comments
Open

Can't use the React hook in Expo #18

jackguo709 opened this issue Nov 21, 2024 · 3 comments

Comments

@jackguo709
Copy link

expo/tsconfig.base uses modulResolution: "node". So when I try to import { useTTS } from "@cartesia/cartesia-js/react", it says the result could not be resolved. Any workarounds?

@jackguo709
Copy link
Author

jackguo709 commented Nov 21, 2024

I ended up using

import "partysocket/event-target-polyfill";
import { useTTS } from "@cartesia/cartesia-js/dist/react";

However, I don't hear any sound. I just copy-pasted from the sample code:

tts
      .buffer({
        model_id: "sonic-english",
        voice: {
          mode: "id",
          id: "a0e99841-438c-4a64-b679-ae501e7d6091",
        },
        transcript: "hello there",
      })
      .then(async () => {
        await tts.play();
      });

@jadams777
Copy link

Hi, did you ever get this working?

@jackguo709
Copy link
Author

Nope. I've moved on to working on something else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants