matatonic / openedai-speech

An OpenAI API compatible text to speech server using Coqui AI's xtts_v2 and/or piper tts as the backend.
GNU Affero General Public License v3.0
192 stars 32 forks source link

The Coqui backend can only synthesize English at the moment. #8

Closed zhy844694805 closed 1 month ago

zhy844694805 commented 2 months ago

How can the Coqui backend synthesize Japanese, Korean, and Chinese?

matatonic commented 2 months ago

That's true for now yes, the openai api doesn't support other languages at the moment - there is no way to pass a language. If you want to hack another language (Coqui supports 16 languages), you can change the hardcoded language here:

https://github.com/matatonic/openedai-speech/blob/main/speech.py#L40

        file_path = self.xtts.tts_to_file(
            text,
            language='en',
            speaker_wav=speaker_wav,
            speed=speed,
            file_path=file_path,
        )
matatonic commented 2 months ago

If I added support for a language field in the voice_to_speaker.yaml file - would that be of use? That should be easy for me and not break the API.

zhy844694805 commented 2 months ago

Your help has made a significant difference, and I am deeply thankful for your efforts. It is people like you who make a positive impact, and I am fortunate to have your support.

matatonic commented 1 month ago

@zhy844694805 I hope the latest update works for you, it enables language changes in the voices config file now.