Inial commited on
Commit
95908f1
·
verified ·
1 Parent(s): 1096f2c

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -0
app.py ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import os
3
+ import subprocess
4
+
5
+ # Chạy cài espeak-ng nếu chưa có
6
+ subprocess.run("apt update && apt install -y espeak-ng", shell=True)
7
+
8
+ def tts_lezgian(text):
9
+ os.system(f'espeak-ng -v lez "{text}" -w output.wav')
10
+ return "output.wav"
11
+
12
+ gr.Interface(fn=tts_lezgian,
13
+ inputs=gr.Textbox(label="Nhập văn bản tiếng Lezgian"),
14
+ outputs=gr.Audio(label="Giọng đọc Lezgian")).launch()