Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
from TTS.tts_model import text_to_speech
|
| 3 |
+
|
| 4 |
+
def tts_interface(text):
|
| 5 |
+
audio, sr = text_to_speech(text)
|
| 6 |
+
return (sr, audio)
|
| 7 |
+
|
| 8 |
+
demo = gr.Interface(
|
| 9 |
+
fn=tts_interface,
|
| 10 |
+
inputs=gr.Textbox(label="اكتب النص العربي هنا"),
|
| 11 |
+
outputs=gr.Audio(label="الصوت الناتج"),
|
| 12 |
+
title="تحويل النص إلى صوت بالعربية (MMS TTS)"
|
| 13 |
+
)
|
| 14 |
+
|
| 15 |
+
if __name__ == "__main__":
|
| 16 |
+
demo.launch()
|