Skip to content
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

Elevenlabs custom voice #9

Open
Tobe2d opened this issue Dec 27, 2023 · 7 comments
Open

Elevenlabs custom voice #9

Tobe2d opened this issue Dec 27, 2023 · 7 comments

Comments

@Tobe2d
Copy link

Tobe2d commented Dec 27, 2023

I would like to add elevenlabs custom voice based on id and name.
custom voice = cloned own voice ;-)

Hope you can help me on this

@KoljaB
Copy link
Owner

KoljaB commented Dec 27, 2023

from elevenlabs import voices, generate, stream

        voice_object = Voice.from_id(id)
        voice_object.settings = VoiceSettings(
            stability=self.stability / 100,
            similarity_boost=self.clarity / 100,
            style=self.style_exxageration / 100,
            use_speaker_boost=True
        )

        audio_stream = generate(
            text=generator,
            voice=voice_object,
            model=model,
            stream=True
        )

        stream(audio_stream)

Roughly like this, hope that helps. Note that streaming only works with the v1 models.

@KoljaB
Copy link
Owner

KoljaB commented Dec 27, 2023

Sry needs this too:
from elevenlabs.api import Voice, VoiceSettings

@Tobe2d
Copy link
Author

Tobe2d commented Dec 27, 2023

Thanks for the reply,

I am getting this error:

Start speaking. I'm all ears.

Can you hear me?
<<< Traceback (most recent call last):
File "E:\Ai__Project\AIVoiceChat\voice_talk_vad.py", line 63, in
voice_object = Voice.from_id(o6y7W8Np)
^^^^^^^^^^^^^^^^^^^^
NameError: name 'o6y7W8Np' is not defined

@KoljaB
Copy link
Owner

KoljaB commented Dec 27, 2023

Pls try:
voice_object = Voice.from_id("o6y7W8Np")

@Tobe2d
Copy link
Author

Tobe2d commented Dec 27, 2023

Moving step ahead.

another error:

NameError: name 'self' is not defined

seems I need to add the name of the model somewhere as it is named in elvenlabs

@KoljaB
Copy link
Owner

KoljaB commented Dec 27, 2023

Replace model with "eleven_monolingual_v1" and the self.stability etc with a value between 0 and 100

@KoljaB
Copy link
Owner

KoljaB commented Dec 27, 2023

Or eleven_multilingual_v1. V2 models dont work with stream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants