Spaces:
Sleeping
Sleeping
Create app.py
Browse files
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()
|