-
Notifications
You must be signed in to change notification settings - Fork 4
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
implement playht and elevenlabs #68
Conversation
…t due to getting blocked
Wow @supercrafter100 this is incredible! Sadly I'm having some significant issues with the
But the vscode workspace immediately closes after playing the audio each time. I can share more in Discord. Is there another way we might play the stream from elevenlabs? Maybe we try piping it into a file and use the existing This means nothing to me but I was able to produce this error message in the console with the
|
I've added a test function that saves it to a file (which I know I can play) but while I see a file, I don't hear anything so I must have some setting wrong? Does doing it this way defeat the whole purpose of streaming the audio anyway? const elevenTTS = async (text, filePath) => {
return new Promise(async (resolve, reject) => {
const elevenLabs = new ElevenLabsClient({
apiKey: config.elevenLabs.apiKey,
});
let audioData = [];
const stream = await elevenLabs.generate({
stream: true,
voice: config.elevenLabs.voiceId,
text: text,
model_id: config.elevenLabs.model,
output_format: config.elevenLabs.outputFormat,
});
stream.on('data', (chunk) => {
audioData.push(chunk);
});
stream.on('end', () => {
const audioBuffer = Buffer.concat(audioData);
let wav = new WaveFile();
wav.fromScratch(1, config.elevenLabs.sampleRate, '32', audioBuffer);
fs.writeFileSync(filePath, wav.toBuffer());
resolve();
});
});
}; |
No description provided.