Initial commit
This commit is contained in:
commit
e2fdb9802a
6 changed files with 51 additions and 0 deletions
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
.direnv/
|
||||||
|
.envrc
|
||||||
|
*.wav
|
||||||
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
[submodule "coqui-ai-TTS"]
|
||||||
|
path = coqui-ai-TTS
|
||||||
|
url = https://github.com/idiap/coqui-ai-TTS
|
||||||
10
README.md
Normal file
10
README.md
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
# BahnansagenTTS
|
||||||
|
|
||||||
|
|
||||||
|
## Project Setup
|
||||||
|
|
||||||
|
1. Install python3.12 and ffmpeg7.0
|
||||||
|
2. ```git submodule init```
|
||||||
|
3. ```cd coqui-ai-TTS && pip install -e .```
|
||||||
|
4. ```pip install -r requirements.txt``` in project root
|
||||||
|
5. Profit
|
||||||
33
ansage.py
Normal file
33
ansage.py
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
import torch
|
||||||
|
from TTS.api import TTS
|
||||||
|
|
||||||
|
# Get device
|
||||||
|
device = "cuda" if torch.cuda.is_available() else "cpu"
|
||||||
|
|
||||||
|
# List available 🐸TTS models
|
||||||
|
print(TTS().list_models())
|
||||||
|
|
||||||
|
# Initialize TTS
|
||||||
|
tts = TTS("tts_models/multilingual/multi-dataset/xtts_v2").to(device)
|
||||||
|
|
||||||
|
# List speakers
|
||||||
|
print(tts.speakers)
|
||||||
|
|
||||||
|
# Run TTS
|
||||||
|
# ❗ XTTS supports both, but many models allow only one of the `speaker` and
|
||||||
|
# `speaker_wav` arguments
|
||||||
|
|
||||||
|
# TTS with list of amplitude values as output, clone the voice from `speaker_wav`
|
||||||
|
#wav = tts.tts(
|
||||||
|
# text="Hello world!",
|
||||||
|
# speaker_wav="my/cloning/audio.wav",
|
||||||
|
# language="en"
|
||||||
|
#)
|
||||||
|
|
||||||
|
# TTS to a file, use a preset speaker
|
||||||
|
tts.tts_to_file(
|
||||||
|
text="Hallo Oliver, herzlichen Glückwunsch zur erfolgreichen Entlastung",
|
||||||
|
speaker_wav="./0248.wav",
|
||||||
|
language="en",
|
||||||
|
file_path="output2.wav"
|
||||||
|
)
|
||||||
1
coqui-ai-TTS
Submodule
1
coqui-ai-TTS
Submodule
|
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit d72c0d539b1e6d5880084d8a18a3e489de331075
|
||||||
1
requirements.txt
Normal file
1
requirements.txt
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
torchaudio==2.6
|
||||||
Loading…
Add table
Add a link
Reference in a new issue