text-to-speech / app.py
Sonu Sharma
Upload 3 files
ea9036c
raw
history blame
881 Bytes
from subprocess import call
import gradio as gr
import os
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="filepath", label="Output Audio")
title = "Text To Speech"
description = "An example of using TTS to generate speech from text."
article = ""
examples = [
["This is an open-source library that generates synthetic speech!=1"]
]
gr.Interface(
inference,
inputs,
outputs,
verbose=True,
title=title,
description=description,
article=article,
examples=examples,
enable_queue=True,
allow_flagging="never",
).launch(debug=True)