Lost_Edge/VoiceGenerator/GenerateDialogue.py

12 lines
534 B
Python
Raw Normal View History

2024-12-10 21:37:54 +00:00
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.",
2024-12-13 16:21:21 +00:00
voice_dir=".\\voices\\",
2024-12-13 12:55:45 +00:00
speaker="Test",
file_path=".\\output\\Test.wav")