Open didemkkaslan opened 1 month ago
I'm trying to use the code inside text_to_speech_stream.ts to get audio stream and upload it on aws s3 but it gives me below error.
text_to_speech_stream.ts
/** * Uses the ElevenLabs API to convert text to audio * @param text The text to convert to audio * @returns The URL of the audio file */ export const textToSpeech: (text: string) => Promise<Buffer> = async ( text: string ) => { return new Promise(async (resolve, reject) => { try { const audioStream = await elabs.generate({ voice: "Rachel", model_id: "eleven_turbo_v2", text, }); console.log("audioStream", audioStream); console.log(typeof audioStream); const chunks: Buffer[] = []; for await (const chunk of audioStream) { chunks.push(chunk); } const audio = Buffer.concat(chunks); resolve(audio); } catch (error) { console.log("error", error); reject(error); } }); };
Hi there, I want to ask that whether your app is capturing users voice from twilio and converting it to text or not?
I'm trying to use the code inside
text_to_speech_stream.ts
to get audio stream and upload it on aws s3 but it gives me below error.