Hi! We are using import { WebPlayer } from "@cartesia/cartesia-js" to then create a player to play response.source on a webpage. Trying to do everything as the github docs page says. Unfortunately upon const player = new WebPlayer() we get an error in the console saying "Right side of assignment cannot be destructured". Could you please help - whats the proper way of creating and using your WebPlayer? Thank you in advance
#WebPlayer throws error on creating the player object
1 messages · Page 1 of 1 (latest)
Looking into this.
Could you share your Node version as well as Cartesia client version?
Oh this is the browser!
Which browser?
iOS safari
Unfortunately dont have full access to a proper console. Using eruda js
Shall I try chrome?
Tried this on mac os safari. Here are the details
It seems like it gets stuck here
constructor({ bufferDuration }) {
__privateAdd(this, _playBuffer);
Ok I just tried to do const player = new WebPlayer({bufferDuration:1}) and the audio went ok. I guess this parameter is required? And what exactly does it do? Thank you
That parameter sets how much to buffer before playing the first chunk. In the playground we adjust it dynamically based on latency.