elevenlabs / elevenlabs-js

The official JavaScript (Node) library for ElevenLabs Text to Speech.
https://elevenlabs.io
MIT License
146 stars 15 forks source link

`TextToSpeech.convertWithTimstamps` response is `Promise<unknown>` #80

Open hkfi opened 3 months ago

hkfi commented 3 months ago

It would be nice to have a typed response.

Eg.

{
  audio_base64: string;
  alignment: {
    characters: Array<string>;
    character_start_times_seconds: Array<number>;
    character_end_times_seconds: Array<number>;
  };
  normalized_alignment: {
    characters: Array<string>;
    character_start_times_seconds: Array<number>;
    character_end_times_seconds: Array<number>;
  };
}
maximedupre commented 2 months ago

I just get undefined 🤷🏻‍♂️

const audioStream = await elevenlabs.textToSpeech.streamWithTimestamps(
    SARAH_VOICE_ID,
    { text }
);

console.log(audioStream) // undefined 
horbel commented 3 weeks ago

Hi, any updates on this?

psioukas commented 3 weeks ago

I just get undefined 🤷🏻‍♂️

const audioStream = await elevenlabs.textToSpeech.streamWithTimestamps(
    SARAH_VOICE_ID,
    { text }
);

console.log(audioStream) // undefined 

Same for me! Do we need to handle this in another way?

maximedupre commented 3 weeks ago

I switched to calling the API directly instead of using the SDK. It's really not any harder to just make the http requests and you'll be able to use all the features.