Merge pull request #8 from fakerybakery/main
Handle edge case, improve model caching, enhance API, add auto GPU support, add WebUI, add CLI
This commit is contained in:
96
README.md
96
README.md
@@ -23,18 +23,84 @@ Some other features include:
|
||||
- The Chinese speaker supports `mixed Chinese and English`.
|
||||
- Fast enough for `CPU real-time inference`.
|
||||
|
||||
## Install on Linux
|
||||
## Install on Linux or macOS
|
||||
|
||||
```bash
|
||||
git clone git@github.com:myshell-ai/MeloTTS.git
|
||||
git clone git+https://github.com/myshell-ai/MeloTTS.git
|
||||
cd MeloTTS
|
||||
pip install -e .
|
||||
python -m unidic download
|
||||
```
|
||||
We welcome the open-source community to make this repo `Mac` and `Windows` compatible. If you find this repo useful, please consider contributing to the repo.
|
||||
|
||||
We welcome the open-source community to make this repo `Windows` compatible. If you find this repo useful, please consider contributing to the repo.
|
||||
|
||||
## Usage
|
||||
|
||||
### English with Multi Accents
|
||||
An unofficial [live demo](https://huggingface.co/spaces/mrfakename/MeloTTS) is hosted on Hugging Face Spaces.
|
||||
|
||||
### WebUI
|
||||
|
||||
The WebUI supports muliple languages and voices. First, follow the installation steps. Then, simply run:
|
||||
|
||||
```bash
|
||||
melo-ui
|
||||
# Or: python melo/app.py
|
||||
```
|
||||
|
||||
### CLI
|
||||
|
||||
You may use the MeloTTS CLI to interact with MeloTTS. The CLI may be invoked using either `melotts` or `melo`. Here are some examples:
|
||||
|
||||
**Read English text:**
|
||||
|
||||
```bash
|
||||
melo "Text to read" output.wav
|
||||
```
|
||||
|
||||
**Specify a language:**
|
||||
|
||||
```bash
|
||||
melo "Text to read" output.wav --language EN
|
||||
```
|
||||
|
||||
**Specify a speaker:**
|
||||
|
||||
```bash
|
||||
melo "Text to read" output.wav --language EN --speaker EN-US
|
||||
melo "Text to read" output.wav --language EN --speaker EN-AU
|
||||
```
|
||||
|
||||
The available speakers are: `EN-Default`, `EN-US`, `EN-BR`, `EN-INDIA` `EN-AU`.
|
||||
|
||||
**Specify a speed:**
|
||||
|
||||
```bash
|
||||
melo "Text to read" output.wav --language EN --speaker EN-US --speed 1.5
|
||||
melo "Text to read" output.wav --speed 1.5
|
||||
```
|
||||
|
||||
**Use a different language:**
|
||||
|
||||
```bash
|
||||
melo "语音合成领域近年来发展迅速" zh.wav -l ZH
|
||||
```
|
||||
|
||||
**Load from a file:**
|
||||
|
||||
```bash
|
||||
melo file.txt out.wav --file
|
||||
```
|
||||
|
||||
The full API documentation may be found using:
|
||||
|
||||
```bash
|
||||
melo --help
|
||||
```
|
||||
|
||||
### Python API
|
||||
|
||||
#### English with Multiple Accents
|
||||
|
||||
```python
|
||||
from melo.api import TTS
|
||||
|
||||
@@ -42,8 +108,8 @@ from melo.api import TTS
|
||||
speed = 1.0
|
||||
|
||||
# CPU is sufficient for real-time inference.
|
||||
# You can also change to cuda:0
|
||||
device = 'cpu'
|
||||
# You can set it manually to 'cpu' or 'cuda' or 'cuda:0' or 'mps'
|
||||
device = 'auto' # Will automatically use GPU if available
|
||||
|
||||
# English
|
||||
text = "Did you ever hear a folk tale about a giant turtle?"
|
||||
@@ -91,7 +157,8 @@ output_path = 'es.wav'
|
||||
model.tts_to_file(text, speaker_ids['ES'], output_path, speed=speed)
|
||||
```
|
||||
|
||||
### French
|
||||
#### French
|
||||
|
||||
```python
|
||||
from melo.api import TTS
|
||||
|
||||
@@ -107,7 +174,8 @@ output_path = 'fr.wav'
|
||||
model.tts_to_file(text, speaker_ids['FR'], output_path, speed=speed)
|
||||
```
|
||||
|
||||
### Chinese
|
||||
#### Chinese
|
||||
|
||||
```python
|
||||
from melo.api import TTS
|
||||
|
||||
@@ -123,7 +191,8 @@ output_path = 'zh.wav'
|
||||
model.tts_to_file(text, speaker_ids['ZH'], output_path, speed=speed)
|
||||
```
|
||||
|
||||
### Japanese
|
||||
#### Japanese
|
||||
|
||||
```python
|
||||
from melo.api import TTS
|
||||
|
||||
@@ -139,7 +208,8 @@ output_path = 'jp.wav'
|
||||
model.tts_to_file(text, speaker_ids['JP'], output_path, speed=speed)
|
||||
```
|
||||
|
||||
### Korean
|
||||
#### Korean
|
||||
|
||||
```python
|
||||
from melo.api import TTS
|
||||
|
||||
@@ -156,7 +226,9 @@ model.tts_to_file(text, speaker_ids['KR'], output_path, speed=speed)
|
||||
```
|
||||
|
||||
## License
|
||||
This library is under MIT License. Free for both commercial and non-commercial use.
|
||||
|
||||
## Acknowledgement
|
||||
This library is under MIT License, which means it is free for both commercial and non-commercial use.
|
||||
|
||||
## Acknowledgements
|
||||
|
||||
This implementation is based on several excellent projects, [TTS](https://github.com/coqui-ai/TTS), [VITS](https://github.com/jaywalnut310/vits), [VITS2](https://github.com/daniilrobnikov/vits2) and [Bert-VITS2](https://github.com/fishaudio/Bert-VITS2). We appreciate their awesome work!
|
||||
|
||||
Reference in New Issue
Block a user