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 clone voices in Node.js #12

Open
soylomass opened this issue Nov 10, 2024 · 0 comments
Open

Can't clone voices in Node.js #12

soylomass opened this issue Nov 10, 2024 · 0 comments

Comments

@soylomass
Copy link

Using the clone method in Node.js to clone a voice, using a Blob for the voice clip, results in the following error:

[Cartesia] Error cloning voice FetchError: invalid json response body at https://api.cartesia.ai/voices/clone/clip reason: Unexpected token e in JSON at position 0
    at /Users/federico/Projects/miniapps-api/node_modules/node-fetch/lib/index.js:273:32
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at VoiceService.create (/Users/federico/Projects/miniapps-api/src/api/voice/voice.service.ts:212:19)
    at VoiceController.create (/Users/federico/Projects/miniapps-api/src/api/voice/voice.controller.ts:89:12) {
  type: 'invalid-json'
}

After debugging, found out that the API was returning an string (the sdk is only coded to support json responses in the clone method):

'error parsing clip
'

I tried replicating your implementation, but using native Node fetch instead of the package you use (cross-fetch) and it worked, so the problem must be that library messing up with the file somehow.

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

1 participant