Initial commit
This commit is contained in:
commit
e2fdb9802a
6 changed files with 51 additions and 0 deletions
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"
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue