lugia19 / elevenlabslib

Full python wrapper for the elevenlabs API.
MIT License
150 stars 27 forks source link

Adding Professional Voice leads to an error #21

Closed LalaStellune closed 10 months ago

LalaStellune commented 10 months ago

I've added a Professional Voice into the voice library and I got this error:

Traceback (most recent call last):
    voice = user.get_voices_by_name("Voice")[0]
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/elevenlabslib/ElevenLabsUser.py", line 138, in get_voices_by_name
    allVoices = self.get_available_voices()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/elevenlabslib/ElevenLabsUser.py", line 111, in get_available_voices
    availableVoices.append(ElevenLabsVoice.voiceFactory(voiceData, self))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/elevenlabslib/ElevenLabsVoice.py", line 64, in voiceFactory
    raise ValueError(voiceData["category"] + " is not a valid voice category!")
ValueError: professional is not a valid voice category!

When I removed the Professional Voice, it went back to normal

lugia19 commented 10 months ago

Make sure you're on the latest version of the library - professional voices should be fully supported. I have a professional voice in my account and it works fine.

You can do pip --upgrade elevenlabslib