felixwaweru / elevenlabs-node Goto Github PK
View Code? Open in Web Editor NEWEleven Labs text to speech package for NodeJS.
Home Page: https://www.npmjs.com/package/elevenlabs-node
License: MIT License
Eleven Labs text to speech package for NodeJS.
Home Page: https://www.npmjs.com/package/elevenlabs-node
License: MIT License
Hi, I'm trying to get the audio via a firebase function and passing it back to the client to play, but I can't seem to get it to work, how can I make it something I am able to pass by to the client?
EvelevenLabs V2 has been release yesterday: https://github.com/elevenlabs/elevenlabs-python/releases/tag/v0.2.26
Thank you in advance!
Add ElevenLabs API Speech Boost to TTS functions.
It would probably be pretty nice to define the API key when the instance is created. I can add this in if you agree
Description of the problem
Currently, the textToSpeech function in its current implementation, returns a response before the audio file has been fully created. As a result, when attempting to read the audio file immediately after calling textToSpeech, the file might not exist yet, which can lead to errors.
Steps to reproduce
Expected behavior
The textToSpeech
function should return only after the audio file has been completely created and it can be accessed without any issues.
Possible solution
One could modify the textToSpeech
function to return a promise that resolves only after the audio file has been completely created. Below is an example of how this solution could be implemented:
const textToSpeech = async (apiKey, voiceID, fileName, textInput, stability, similarityBoost, modelId) => {
try {
// ... existing code ...
const writeStream = fs.createWriteStream(fileName);
response.data.pipe(writeStream);
return new Promise((resolve, reject) => {
writeStream.on('finish', () => resolve(fileName));
writeStream.on('error', reject);
});
} catch (error) {
console.log(error);
}
};
In this code, we create a new promise that resolves with the file name only after the writing of the file has been completed. This way, the textToSpeech function resolves only after the audio file has been fully created.
I hope this suggestion is useful and can be implemented to avoid issues when trying to access the audio file immediately after calling textToSpeech. I appreciate your attention and look forward to a prompt resolution.
Is your feature request related to a problem? Please describe.
I would like to generate speech using text-to-speech API, then store the mp3 not locally on my machine, but on a server (or in a amazon bucket or firease storage bucket). The way the repo is currently structured, this seems not to be supported.
Describe the solution you'd like
Ideally an alternative return value in form of the blob audio should be provided (instead of writing to the filesystem).
Describe alternatives you've considered
Using elevenlabs API directly (which I'm doing currently).
Describe the solution you'd like
Addition of customizable response types for the textToSpeechStream function. i.e (arrayBuffer, stream, etc)
I try to pass the filename, but it is not creating file
/**
* text to speech
*/
const textToSpeech = async () => {
try {
voice
.textToSpeech(
xiKey,
'wnDO7pToxAu1uMylONP0',
'1.mp3',
'Welcome to callanswering!, My name is Sagar Davara and how may I help you ?'
)
.then((res) => {
console.log(res)
})
} catch (error) {
console.log(error)
}
}
Add more options to the audio streaming feature
Create a Github workflow that builds, tests and publishes the package on NPM.
Configure to make it run on test branch.
😕
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
https://help.elevenlabs.io/hc/en-us/articles/15726761640721-Can-I-reduce-API-latency
Describe the solution you'd like
A clear and concise description of what you want to happen.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
In which place should I put it?
Additional context
Add any other context or screenshots about the feature request here.
There should be the option to create a voice, since the API supports it. It would function almost identically to the "edit voice" function.
I am stupid. thank you.
How can i switch the language?
I don´t know if it is possible because also I coudn´t find that option in the oficial api documentation.
Is your feature request related to a problem? Please describe.
11labs has a new API endpoint "Speech-to-speech" https://elevenlabs.io/docs/api-reference/speech-to-speech
Describe the solution you'd like
Native support in your API
Add Jest unit tests for functions.
Simple feature request, to add function for GET /v1/models request
https://docs.elevenlabs.io/api-reference/models-get
Is your feature request related to a problem? Please describe.
Websockets don't seem to be supported by this library, would be good to add.
Describe the solution you'd like
A wrapper function similar to the current ones that lets you setup websockets.
Describe alternatives you've considered
Simply using the raw Websocket endpoint
Not quite sure if this is a issue or not, but when using the package for small amounts of text it works just fine, but when using it with larger samples it just errors...
To be fair I have myself got the same exact error when trying to use the API directly, but I'm not quite sure why this is happening. According to the API documentation, the max amount of characters should be 5000, but both your package and my direct use of the API error after around 500 characters
Describe the bug
I read on Eleventlabs docs that Portuguese is one of the supported languages, and I'm trying to make it speak in Brazilian Portuguese, but I can't.
In fact, I didn't find where to say language:pt-BR
or something like that. I just sent a Brazilian written text.
But the result is some like an American trying to read in Portuguese, it's annoying. 😅
Expected behavior
To ask voice.textToSpeechStream
with the desired language as a parameter.
. . .
Could you guys help me make it work?
Add a CONTRIBUTING.md file to the root folder to specify the open source contribution guidelines.
Additionally, link it in the README and Github repo sidebar.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.