firstProject / app.py
ghadaAlmuaikel's picture
Create app.py
f84c0b6 verified
raw
history blame
531 Bytes
import gradio as gr
from gtts import gTTS
import os
def greet(name):
greeting_text = f"Hello, {name}! Welcome to our AI-powered voice greeting system."
tts = gTTS(text=greeting_text, lang='en')
tts.save("greeting.mp3")
return "greeting.mp3"
# Create Gradio interface
iface = gr.Interface(
fn=greet,
inputs="text",
outputs="audio",
title="AI Voice Greeting",
description="Enter your name and receive a personalized greeting as an AI-generated voice."
)
# Launch the interface
iface.launch()