Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,20 +1,19 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
from TTS_X.tts import generate_voice
|
| 3 |
-
import gradio as gr
|
| 4 |
-
from openai_tts import generate_audio_from_text
|
| 5 |
|
| 6 |
-
def tts_interface(text
|
| 7 |
-
audio_path =
|
| 8 |
return audio_path
|
| 9 |
|
| 10 |
-
gr.
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
gr.Textbox(label="اكتب
|
| 14 |
-
gr.
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
| 20 |
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
from TTS_X.tts import generate_voice
|
|
|
|
|
|
|
| 3 |
|
| 4 |
+
def tts_interface(text):
|
| 5 |
+
audio_path = generate_voice(text)
|
| 6 |
return audio_path
|
| 7 |
|
| 8 |
+
with gr.Blocks() as demo:
|
| 9 |
+
gr.Markdown("## 🎤 Text to Speech using OpenAI TTS (Nova Voice)")
|
| 10 |
+
with gr.Row():
|
| 11 |
+
txt = gr.Textbox(label="اكتب نصك هنا")
|
| 12 |
+
btn = gr.Button("حوّل إلى صوت")
|
| 13 |
+
audio_output = gr.Audio(label="الصوت الناتج")
|
| 14 |
+
|
| 15 |
+
btn.click(fn=tts_interface, inputs=txt, outputs=audio_output)
|
| 16 |
+
|
| 17 |
+
demo.launch()
|
| 18 |
+
|
| 19 |
|