cogentapps / chat-with-gpt

An open-source ChatGPT app with a voice
https://www.chatwithgpt.ai
MIT License
2.3k stars 493 forks source link

Custom cloned voice #86

Closed wyhauyeung closed 1 year ago

wyhauyeung commented 1 year ago

Is there a way I can choose custom cloned voice I made in eleven labs?

vesector commented 1 year ago

I guess you may need to check this part of the code and play accordingly... potentially yes.

Part of the code: https://github.com/cogentapps/chat-with-gpt/blob/6296d9891103d3f7a1e78272ccc9f56329e4176d/app/src/tts/defaults.ts

@cogentapps may be able to point this into the correct direction.

ghgoodreau commented 1 year ago

@wyhauyeung As a quick fix, if you are running this locally, you can add your custom cloned voice to app/src/tts/defaults.ts. Here is an example snippet:

export const defaultVoiceList = [
    {
        "voice_id": "Enter custom voice ID here",
        "name": "Enter custom name here",
        "preview_url": "", // this can be blank, the preview button just won't do anything.
    },
    {
        "voice_id": "21m00Tcm4TlvDq8ikWAM",
        "name": "Rachel",
        "preview_url": "https://storage.googleapis.com/eleven-public-prod/premade/voices/21m00Tcm4TlvDq8ikWAM/6edb9076-c3e4-420c-b6ab-11d43fe341c8.mp3",
    },

This will then show up in the voice select dropdown. If you then select your custom cloned voice, it will work properly.

I don't have the bandwidth to make an actual PR for this but a suggested change for anyone reading would be to either add an input field for these custom voices that adds to this array, or have this file pull the custom voices from https://api.elevenlabs.io/docs#/voices/Get_voices_v1_voices_get.

cogentapps commented 1 year ago

Today's update adds a "Custom Voice" option on the ElevenLabs voice dropdown, which you can use to select a custom voice from your account.

Let me know if you have any issues making it work.

Tobe2d commented 8 months ago

It is not saving the vocie ID image When I try ading the voice id and hit save nothing happens. and when I open settings again in the same session it is empty again