coqui-ai-tts / app.py
Ahsen Khaliq
Update app.py
44d995e
import os
os.system('pip install gradio==2.3.0a0')
os.system('pip freeze')
import gradio as gr
from subprocess import call
def run_cmd(command):
try:
print(command)
call(command)
except KeyboardInterrupt:
print("Process interrupted")
sys.exit(1)
def inference(text):
cmd = ['tts', '--text', text]
run_cmd(cmd)
return 'tts_output.wav'
inputs = gr.inputs.Textbox(lines=5, label="Input Text")
outputs = gr.outputs.Audio(type="file",label="Output Audio")
title = "coqui-ai-TTS"
description = "Gradio demo for coqui-ai-TTS: a deep learning toolkit for Text-to-Speech, battle-tested in research and production. To use it, simply add your text, or click one of the examples to load them. Read more at the links below."
article = "<p style='text-align: center'><a href='https://tts.readthedocs.io/en/latest/'>TTS is a library for advanced Text-to-Speech generation</a> | <a href='https://github.com/coqui-ai/TTS'>Github Repo</a></p>"
examples = [
["This is an open-source library that generates synthetic speech!"]
]
gr.Interface(inference, inputs, outputs, title=title, description=description, article=article, examples=examples, enable_queue=True ).launch()