NeonBohdan's picture
Added app
7c206f9
raw
history blame
984 Bytes
import tempfile
import gradio as gr
from neon_tts_plugin_coqui import CoquiTTS
LANGUAGES = [
"en",
"pl",
"uk",
]
coquiTTS = CoquiTTS()
def tts(text: str, language: str):
print(text, language)
# return output
with tempfile.NamedTemporaryFile(suffix=".wav", delete=False) as fp:
coquiTTS.get_tts(text, fp, speaker = {"language" : language})
return fp.name
iface = gr.Interface(
fn=tts,
inputs=[
gr.inputs.Textbox(
label="Input",
default="Hello, how are you?",
),
gr.inputs.Radio(
label="Pick a Language",
choices=LANGUAGES,
),
],
outputs=gr.outputs.Audio(label="Output"),
title="๐Ÿธ๐Ÿ’ฌ - NeonAI Coqui AI TTS Plugin",
theme="huggingface",
description="๐Ÿธ๐Ÿ’ฌ - a deep learning toolkit for Text-to-Speech, battle-tested in research and production",
article="more info at https://github.com/coqui-ai/TTS",
)
iface.launch()