wedyanessam's picture
Update app.py
9dd7b34 verified
raw
history blame
726 Bytes
import gradio as gr
from TTS_X.tts import generate_voice
import gradio as gr
from openai_tts import generate_audio_from_text
def tts_interface(text, voice):
audio_path = generate_audio_from_text(text, voice)
return audio_path
gr.Interface(
fn=tts_interface,
inputs=[
gr.Textbox(label="اكتب النص هنا", placeholder="مثال: أهلاً وسهلاً!"),
gr.Dropdown(["onyx", "nova", "echo", "fable", "alloy"], label="اختيار الصوت", value="onyx")
],
outputs=gr.Audio(label="الصوت الناتج", type="filepath"),
title="🔊 OpenAI TTS بالعربي",
description="تحويل النص إلى صوت باستخدام نموذج OpenAI TTS"
).launch()