AmigosTTS / app.py
Sasank Ramaraju
Fix Synthesizer issue
928de2f
Raw History Blame Contribute Delete
766 Bytes
import io
from TTS.utils.synthesizer import Synthesizer
import gradio as gr
# Download and initialize model
synthesizer = Synthesizer(
tts_checkpoint=model_path,
tts_config_path=config_path,
tts_speakers_file=speakers_file_path,
tts_languages_file=None,
vocoder_checkpoint=vocoder_path,
vocoder_config=vocoder_config_path,
encoder_checkpoint="",
encoder_config="",
use_cuda=args.use_cuda,
)
def generate_tts(text):
wav = synthesizer.tts(text)
out = io.BytesIO()
synthesizer.save_wav(wav, out)
out.seek(0)
return out
iface = gr.Interface(
fn=generate_tts,
inputs=gr.Textbox(label="Enter text"),
outputs=gr.Audio(type="filepath", label="Generated Audio"),
title="Amigos TTS"
)
iface.launch()