File size: 530 Bytes
f980f8c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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()