12 lines
534 B
Python
12 lines
534 B
Python
|
import torch
|
||
|
from TTS.api import TTS
|
||
|
|
||
|
# Get device
|
||
|
device = "cuda" if torch.cuda.is_available() else "cpu"
|
||
|
tts = TTS("tts_models/multilingual/multi-dataset/bark").to(device)
|
||
|
|
||
|
tts.tts_to_file(text="Greetings Martin. This is a synthesized speech for future dialogues. \
|
||
|
As you can see [cough] I mean hear... Yes, hear with your own ears, the speech trained from 2min audio is indeed impressive.",
|
||
|
voice_dir=".\\voices\\",
|
||
|
speaker="Test",
|
||
|
file_path=".\\output\\Test.wav")
|