chuvashtts / app.py
ollui's picture
Create app.py
58333de verified
raw
history blame contribute delete
578 Bytes
import gradio as gr
import subprocess
import uuid
import os
def chuvash_tts(text):
filename = f"/tmp/{uuid.uuid4()}.wav"
cmd = f'espeak-ng -v cv "{text}" -w {filename}'
subprocess.run(cmd, shell=True)
return filename
with gr.Blocks() as demo:
gr.Markdown("## Chuvash TTS using eSpeak NG")
with gr.Row():
inp = gr.Textbox(label="Nhập văn bản tiếng Chuvash")
out = gr.Audio(label="Phát âm", type="filepath")
btn = gr.Button("Chuyển thành giọng nói")
btn.click(fn=chuvash_tts, inputs=inp, outputs=out)
demo.launch()