22 lines
483 B
Python
22 lines
483 B
Python
import torch
|
|
from TTS.api import TTS
|
|
|
|
|
|
def main():
|
|
device = "cuda" if torch.cuda.is_available() else "cpu"
|
|
print(TTS().list_models().list_models())
|
|
|
|
tts = TTS(
|
|
model_name="tts_models/multilingual/multi-dataset/xtts_v2", progress_bar=False
|
|
).to(device)
|
|
|
|
tts.tts_to_file(
|
|
"Esto es una prueba. Esto es otra prueba!!",
|
|
speaker="Gracie Wise",
|
|
language="es",
|
|
file_path="output.wav",
|
|
)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|