Skip to content

Coqui‐TTS Tools

Marco BARNIG edited this page Jul 15, 2024 · 15 revisions

1. Coqui-TTS Fork

Coqui TTS was a continuation of Mozilla's TTS : some time ago Mozilla stopped working on their TTS project, and Coqui.ai was founded by the founders of Mozilla’s machine learning group. Coqui was licensed under MPL-2.0, which allows commercial use. Over the last years, the start-up Coqui.ai built open sourced STT and TTS engines which have been used by hundreds of thousands of people. Also, they kicked off projects open sourcing thousands of hours of speech training data. A vital, knowledgeable, and supportive community joined the cause and accelerated progress exponentially. But early 2024 the start-up shut down and the project is no longer supported. To prevent the disappearance of the Coqui-TTS repository on Github, I forked the most recent version into my own Github account.

Erno Hermann is a postdoctoral researcher at the Idiap Research Institute at École Polytechnique Fédérale de Lausanne (EPFL) who maintains an updated version of the Coqui-TTS project in his Github repository.

2. Modifications

I did some small modifications in the forked repository. First I added a small Python script test-cuda.py with the following content :

import torch 
x = torch.rand(5, 3) 
print(x) 
print(torch.cuda.is_available()) 

Next I added the following function to the script TTS/tts/datasets/formatters.py to handle the luxembourgish dataset with the audio files recorded by Max Kuborn :

def luxembourgish(root_path, meta_file, **kwargs):  # pylint: disable=unused-argument
    txt_file = os.path.join(root_path, meta_file)
    items = []
    speaker_name = "Max-Kuborn"
    with open(txt_file, "r", encoding="utf-8") as ttf:
        for line in ttf:
            cols = line.split("|")
            wav_file = os.path.join(root_path, "wavs", cols[0] + ".wav")
            text = cols[1]
            items.append({"text": text, "audio_file": wav_file, "speaker_name": speaker_name, "root_path": root_path})
    return items

3. Installation of Coqui-TTS

To install the Coqui-TTS tools, I cloned the forked repository into the folder TTS-for-LOD on my Samsung disk D with the command git clone https://github.com/mbarnig/Coqui-TTS.git.

Clone this wiki locally