#yes, i did

1 messages · Page 1 of 1 (latest)

west axle
#

You should be getting a different error code. Can you share your code here without the API KEY and we'll see what we can do for you..

fickle glacier
west axle
#

it looks like you are only importing VoiceSettings from ElevenLabs. That's my "first glance" idea.. Let me know if it works

fickle glacier
#

I don't understand, what else should i import?
FYI: This code was working at least 10 times before i got the error

west axle
#

Becuse there is a limit to how many free reuests you can make to the API boefre it stops you

#

Just import the whole module

fickle glacier
#

Does that limit reset?

west axle
#

No

#

But as you are now using your API key you'll be using that limit

#

once you pass the api key properly

fickle glacier
#

So after this error, the quota has been exceeded and i will no longer be able to generate any more speech, Is that correct?

west axle
#

It is a different quota

#

bofre it was the "trial"

#

now you are a "free subsciber" so it has a different limit

fickle glacier
#

So i must subscribe to a premium plan to generate more?? Or can i use a different account for another api and continue?

west axle
#

yes

#

You can not make more than one free account or your IP address will be banned

fickle glacier
#

Oh ok, so there is no way to generate more speech using elevenlabs api once the limit has been exceeded?

west axle
#

you have not used your 10,000 characters yet as you have not passed your API key

fickle glacier
#

Even if i pass my API key in the code, i get that same error message

west axle
#

You are not passing it correctly then

#

Did you import the whole module?

fickle glacier
#

how should i pass it?
i imported: import random
import os

import customtkinter
import moviepy.video.fx.all as vfx
from CTkMessagebox import CTkMessagebox
from gtts import gTTS
from moviepy.editor import AudioFileClip, VideoFileClip
from elevenlabs import VoiceSettings
from elevenlabs.client import ElevenLabs

west axle
#

import ElevenLabs

#

the whole thing

#

I don't know how it works if you are not using the Generate function so just import the whole thing

fickle glacier
#

how do i install Elevenlabs using pip or file?

#

if i try pip install elevenlabs, its already installed

west axle
#

import os

import customtkinter
import moviepy.video.fx.all as vfx
from CTkMessagebox import CTkMessagebox
from gtts import gTTS
from moviepy.editor import AudioFileClip, VideoFileClip
import elevenlabs
from elevenlabs.client import ElevenLabs

#

you ahve it installed but you need to import it to your project

fickle glacier
#

I dont know if i am doing something wrong but, even with the correct API and correct modules, it shows the same error message

#

Can you please help me?

west axle
#

I am, please be patient

#
        # Calling the text_to_speech conversion API with detailed parameters
        response = self.client.text_to_speech.convert(
            voice_id="pNInz6obpgDQGcFmaJgB",  
            optimize_streaming_latency="0",
            output_format="mp3_44100_128",  # Update this line to choose a supported format
            text=self.textbox.get("0.0", "end"),
            model_id="eleven_turbo_v2",  # use the turbo model for low latency, for other languages use the `eleven_multilingual_v2`
            voice_settings=VoiceSettings(
                stability=0.0,
                similarity_boost=1.0,
                style=0.0,
                use_speaker_boost=True,
            ),

As you are using self.client.text_to_speech.convert rather than the helper function I can't easily see where the issue is.

fickle glacier
#

So is there no quick easy fix for this?

west axle
#

from elevenlabs import Voice, VoiceSettings, play
from elevenlabs.client import ElevenLabs

client = ElevenLabs(
api_key="YOUR_API_KEY", # Defaults to ELEVEN_API_KEY
)

audio = client.generate(
text="Hello! My name is Bella.",
voice=Voice(
voice_id='EXAVITQu4vr4xnSDxMaL',
settings=VoiceSettings(stability=0.71, similarity_boost=0.5, style=0.0, use_speaker_boost=True)
)
)

play(audio)

#

Try using this and modify it to suit your needfs

#

Sorry I'm tryig to help while at wokr

fickle glacier
#

Oh, I am sorry i didn't know that; I am sorry but it gives an error as well,
audio = client.generate(
AttributeError: 'ElevenLabs' object has no attribute 'generate'

west axle
#

self.client.generate as you built client ontop of self

fickle glacier
west axle
#

waiit

#

Have your added your API key to your environment correctly?

fickle glacier
#

yes.
client = ElevenLabs(
api_key="API KEY" # Defaults to ELEVEN_API_KEY
)

#

I insert my actual api key there

west axle
#

but os.getenv(xxx) means something else

#

get rid of the os.getenv and just put the key in ELEVENLABS_API_KEY =