Git Product home page Git Product logo

elevenlabs-node's Introduction

Hi there

📫 Socials

🕵🏽‍♂️ Just tracking something. You can ignore me

HitCount

elevenlabs-node's People

Contributors

felixwaweru avatar keystonescience avatar mgorsk1 avatar pathrom avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

elevenlabs-node's Issues

Passing from server to client

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?

Add Speech Boost

Description

Add ElevenLabs API Speech Boost to TTS functions.

Text to speech not waiting until the audio is created.

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

  1. Call the textToSpeech function and save the response in a variable.
  2. Immediately afterwards, try to read the audio file returned by textToSpeech.

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.

Alternative Audio Storage Option

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).

Not creating file and store the data

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)
	}
}

reduce API latency option

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.
image

Create Voice

There should be the option to create a voice, since the API supports it. It would function almost identically to the "edit voice" function.

Language

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.

Add tests

Add Jest unit tests for functions.

Add Websocket support

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

Text Size

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

Speaking the other languages

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 CONTRIBUTING.md to project

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.