---
license: cc-by-nc-sa-4.0
language:
- en
pipeline_tag: text-to-audio
tags:
- audiocraft
- audiogen
- styletts2
- shift
- sound
- audio-generation
- text-to-speech
- mimic3
---
[](https://shift-europe.eu/)
##
# Affective TTS / Soundscape
Expansion of [SHIFT TTS tool](https://github.com/audeering/shift) with [AudioGen soundscapes](https://huggingface.co/dkounadis/artificial-styletts2/discussions/3)
- [Analysis of emotions of TTS](https://huggingface.co/dkounadis/artificial-styletts2/discussions/2)
- [Listen also foreign languages](https://huggingface.co/dkounadis/artificial-styletts2/discussions/4)
## Available TTS Voices
Listen to available voices! & Foreign languages
## Flask
Build virtualenv & start API
Clone
```
git clone https://huggingface.co/dkounadis/artificial-styletts2
```
Install
```
virtualenv --python=python3 ~/.envs/.my_env
source ~/.envs/.my_env/bin/activate
cd artificial-styletts2/
pip install -r requirements.txt
```
Flask `tmux-session`
```
CUDA_DEVICE_ORDER=PCI_BUS_ID HF_HOME=./hf_home CUDA_VISIBLE_DEVICES=0 python api.py
```
# Demo
```python
# saves demo.wav
CUDA_DEVICE_ORDER=PCI_BUS_ID HF_HOME=./hf_home CUDA_VISIBLE_DEVICES=0 python demo.py
```
# Inference
Following examples need `api.py` to be running. [Set this IP](https://huggingface.co/dkounadis/artificial-styletts2/blob/main/tts.py#L85) to the IP shown when starting `api.py`.
##
## Landscape 2 Soundscape
The following needs `api.py` to be already running on a tmux session.
```python
# TTS & soundscape - overlay to .mp4
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/OBY666_By1k)
[](https://youtu.be/gnGCYLcdLsA)
[](https://www.youtube.com/watch?v=Y8QyYUgLaCg)
[](https://youtu.be/XDDzxDSrhb0)
[](https://youtu.be/I3YYKiUzHpA)
# SoundScape Live (iterative) Demo - Paplay
Special Flask API for playing sounds live
```python
CUDA_DEVICE_ORDER=PCI_BUS_ID HF_HOME=/data/dkounadis/.hf7/ CUDA_VISIBLE_DEVICES=4 python live_api.py
```
Client - Describe any sound with words and it will be played back to you.
```python
python live_demo.py # will ask text input & play soundscape
```
# SoundScape (basic) Demo
```python
CUDA_DEVICE_ORDER=PCI_BUS_ID HF_HOME=/data/dkounadis/.hf7/ CUDA_VISIBLE_DEVICES=4 python demo.py
```
##
# Audiobook
Create audiobook from `.docx`. Listen to it - YouTube [male voice](https://www.youtube.com/watch?v=5-cpf7u18JE) / [female voice](https://www.youtube.com/watch?v=pzrLYCaWD2A)
```python
# generated audiobook will be saved in ./tts_audiobooks
python audiobook.py
```