Inial commited on
Commit
8ebfbef
·
verified ·
1 Parent(s): 3684f07

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -0
app.py ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import os
3
+
4
+ def bashkir_tts(text):
5
+ os.system("apt-get update && apt-get install -y espeak-ng") # Cài espeak-ng khi Spaces khởi động
6
+ os.system(f'espeak-ng -v ba "{text}" -w output.wav') # Tạo file âm thanh từ văn bản
7
+ return "output.wav"
8
+
9
+ iface = gr.Interface(
10
+ fn=bashkir_tts,
11
+ inputs=gr.Textbox(label="Nhập văn bản tiếng Bashkir"),
12
+ outputs=gr.Audio(label="Giọng nói"),
13
+ title="Bashkir TTS",
14
+ description="TTS đơn giản dùng espeak-ng"
15
+ )
16
+
17
+ iface.launch()