justLV / onju-voice

A hackable AI home assistant platform
MIT License
1.31k stars 70 forks source link

Let Elevenlabs use new multilangual v2 model #13

Closed jwhengeveld closed 7 months ago

jwhengeveld commented 1 year ago

At default, the Elevenlabs API uses the old model. The multilangual model v2 is much better and sounds more natural in other languages (Dutch for me)

Here is the code to change the model. For the file elevenlabs.py around line 61

Before:

 def text_to_speech(self, device, text, path_name="data"):
        now = datetime.now()
        now_str = now.strftime("%Y-%m-%d_%H-%M-%S")
        payload = json.dumps({
            "text": text,
        })

After:

 def text_to_speech(self, device, text, path_name="data"):
        now = datetime.now()
        now_str = now.strftime("%Y-%m-%d_%H-%M-%S")
        payload = json.dumps({
            "text": text,
            "model_id": "eleven_multilingual_v2",
        })
pl0ink commented 1 year ago

Great! Results in Dutch are much better. :-)

justLV commented 7 months ago

Closing, but feel free to make a PR.

New 11labs models & py package are much better so probably would benefit from a major overhaul & using streaming