KoljaB / RealtimeTTS

Converts text to speech in realtime
1.39k stars 119 forks source link

ElevenLabs API change #83

Closed jrmann1999 closed 1 month ago

jrmann1999 commented 1 month ago

ElevenLabs has deprecated top level functions:

Exported functions The SDK no longer exports top level functions generate, clone, and voices. Instead, everything is now directly attached to the client instance.

generate -> client.generate

To that end, when using pip to install the most recent version of RealtimeTTS, it installs the newest elevenlabs which breaks RealtimeTTS:

from RealtimeTTS import SystemEngine Traceback (most recent call last): File "", line 1, in File "C:\Users\jerem\OneDrive\Documents\TTS\Lib\site-packages\RealtimeTTS__init.py", line 1, in from .text_to_stream import TextToAudioStream File "C:\Users\jerem\OneDrive\Documents\TTS\Lib\site-packages\RealtimeTTS\text_to_stream.py", line 1, in from .engines import BaseEngine File "C:\Users\jerem\OneDrive\Documents\TTS\Lib\site-packages\RealtimeTTS\engines\init.py", line 4, in from .elevenlabs_engine import ElevenlabsEngine File "C:\Users\jerem\OneDrive\Documents\TTS\Lib\site-packages\RealtimeTTS\engines\elevenlabs_engine.py", line 2, in from elevenlabs import voices, generate, stream ImportError: cannot import name 'generate' from 'elevenlabs' (C:\Users\jerem\OneDrive\Documents\TTS\Lib\site-packages\elevenlabs\init__.py)

I'm sure an engine rewrite is needed, but figured I'd raise the issue since it impacts even when not directly importing the ElevenLabs engine.

KoljaB commented 1 month ago

Thanks for pointing out. Latest version 0.3.47 should now support new elevenlabs api.

jrmann1999 commented 1 month ago

Thanks! I'll test when it hits pip to upgrade.

KoljaB commented 1 month ago

Upped version to 0.3.48 (0.3.47 somehow did not update elevenlabs library). Should be up on pypi now and available with pip install realtimetts==0.3.48 or pip install -U realtimetts.

jrmann1999 commented 1 month ago

Working Great.