firstProject / app.py
ghadaAlmuaikel's picture
Update app.py
d65fb49 verified
raw
history blame
No virus
614 Bytes
import gradio as gr
from gtts import gTTS
import os
def greet(name):
greeting_text = f"مرحباً، {name}! أهلاً بك في نظام تحية الذكاء الاصطناعي."
tts = gTTS(text=greeting_text, lang='ar')
tts.save("greeting.mp3")
return "greeting.mp3"
# Create Gradio interface
iface = gr.Interface(
fn=greet,
inputs="text",
outputs="audio",
title="تحية صوتية بالذكاء الاصطناعي",
description="أدخل اسمك وتلقَّى تحية شخصية بصوت الذكاء الاصطناعي."
)
# Launch the interface
iface.launch()