|
|
--- |
|
|
license: cc-by-nc-sa-4.0 |
|
|
language: |
|
|
- en |
|
|
pipeline_tag: text-to-audio |
|
|
tags: |
|
|
- audiocraft |
|
|
- audiogen |
|
|
- styletts2 |
|
|
- shift-tts |
|
|
- sound |
|
|
- audio-generation |
|
|
- text-to-speech |
|
|
- mimic3 |
|
|
--- |
|
|
|
|
|
Audionar - StyleTTS2 of speakers pregenerated by another TTS |
|
|
|
|
|
[](https://shift-europe.eu/) |
|
|
|
|
|
## |
|
|
|
|
|
# SHIFT TTS / AudioGen |
|
|
|
|
|
Phonetic variation of [SHIFT TTS](https://audeering.github.io/shift/) blend to [AudioGen soundscapes](https://huggingface.co/dkounadis/artificial-styletts2/discussions/3) |
|
|
- [Analysis of emotion of SHIFT TTS](https://huggingface.co/dkounadis/artificial-styletts2/discussions/2) |
|
|
- [Listen Also foreign languages](https://huggingface.co/dkounadis/artificial-styletts2/discussions/4) |
|
|
|
|
|
## Listen Voices |
|
|
|
|
|
|
|
|
<a href="https://huggingface.co/dkounadis/artificial-styletts2/discussions/1">Native English</a> / <a href="https://huggingface.co/dkounadis/artificial-styletts2/discussions/1#6783e3b00e7d90facec060c6">Non-native English: Accents</a> / <a href="https://huggingface.co/dkounadis/artificial-styletts2/discussions/1#6782c5f2a2f852eeb1027a32">Foreign languages</a> |
|
|
|
|
|
## |
|
|
|
|
|
``` |
|
|
CUDA_DEVICE_ORDER=PCI_BUS_ID HF_HOME=/data/.hf7/ CUDA_VISIBLE_DEVICES=0 python demo.py |
|
|
``` |
|
|
|
|
|
## Flask API |
|
|
|
|
|
<details> |
|
|
<summary> |
|
|
Build virtualenv & run api.py |
|
|
</summary> |
|
|
|
|
|
Above [TTS Demo](https://huggingface.co/dkounadis/artificial-styletts2/blob/main/demo.py) is a standalone script that loads TTS & AudioGen models and synthesizes a txt. We also provide a Flask `api.py` that allows faster inference with |
|
|
loading only once the TTS & AudioGen. |
|
|
|
|
|
Clone |
|
|
|
|
|
``` |
|
|
git clone https://huggingface.co/dkounadis/artificial-styletts2 |
|
|
``` |
|
|
Install |
|
|
|
|
|
``` |
|
|
cd artificial-styletts2 |
|
|
virtualenv --python=python3.10 .env0 |
|
|
source .env0/bin/activate |
|
|
pip install -r requirements.txt |
|
|
``` |
|
|
|
|
|
Flask API - open a 2nd terminal |
|
|
|
|
|
``` |
|
|
CUDA_DEVICE_ORDER=PCI_BUS_ID HF_HOME=/data/.hf7/ CUDA_VISIBLE_DEVICES=0 python api.py |
|
|
``` |
|
|
|
|
|
Following examples need `api.py` to be running. [Set this IP](https://huggingface.co/dkounadis/artificial-styletts2/blob/main/tts.py#L93) to the IP shown when starting `api.py`. |
|
|
|
|
|
### Foreign Lang TTS |
|
|
|
|
|
This will produce the following [video](https://www.youtube.com/watch?v=UeJEAsKxRZU). |
|
|
|
|
|
``` |
|
|
# git lfs pull # to download assets/ocr.jpg |
|
|
python tts.py --text assets/ocr.txt --image assets/ocr.jpg --soundscape "battle hero" --voice romanian |
|
|
``` |
|
|
|
|
|
</details> |
|
|
|
|
|
## Landscape 2 Soundscapes |
|
|
|
|
|
The following needs `api.py` to be already running on a tmux session. |
|
|
|
|
|
```python |
|
|
# TTS & soundscape - output .mp4 saved in ./out/ |
|
|
python landscape2soundscape.py |
|
|
``` |
|
|
|
|
|
For SHIFT demo / Collaboration with [SMB](https://www.smb.museum/home/) |
|
|
- YouTube Videos |
|
|
|
|
|
|
|
|
[](https://youtu.be/SSi3gUO4GtY) |
|
|
|
|
|
[](https://youtu.be/2YjxAPkdXIc) |
|
|
|
|
|
[](https://youtu.be/BhMh02knkco) |
|
|
|
|
|
|
|
|
|
|
|
[](https://youtu.be/a3qk9S87v60) |
|
|
|
|
|
[](https://youtu.be/3M0y9OYzDfU) |
|
|
|
|
|
[](https://youtu.be/56MH7zOHrNQ) |
|
|
|
|
|
[](https://youtu.be/gnGCYLcdLsA) |
|
|
|
|
|
[](https://www.youtube.com/watch?v=Y8QyYUgLaCg) |
|
|
|
|
|
[](https://youtu.be/RhUuS9HMLhg) |
|
|
|
|
|
[](https://youtu.be/NzzhhrUeKVY) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# SoundScape Live Demo - Paplay |
|
|
|
|
|
Flask API for playing sounds live |
|
|
|
|
|
```python |
|
|
CUDA_DEVICE_ORDER=PCI_BUS_ID HF_HOME=/data/dkounadis/.hf7/ CUDA_VISIBLE_DEVICES=4 python api.py |
|
|
``` |
|
|
|
|
|
Describe any sound via text, the tts & soundscape is played back |
|
|
|
|
|
```python |
|
|
python live_demo.py # type text & plays AudioGen sound & TTS |
|
|
``` |
|
|
|
|
|
# Audiobook |
|
|
|
|
|
Create audiobook from `.docx`. Listen to it - YouTube [male voice](https://youtu.be/fUGpfq_o_CU) / [female voice](https://www.youtube.com/watch?v=tlRdRV5nm40) |
|
|
|
|
|
```python |
|
|
# audiobook will be saved in ./tts_audiobooks |
|
|
python audiobook.py |
|
|
``` |
|
|
|