Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from gtts import gTTS
|
3 |
+
import os
|
4 |
+
|
5 |
+
def greet(name):
|
6 |
+
greeting_text = f"Hello, {name}! Welcome to our AI-powered voice greeting system."
|
7 |
+
tts = gTTS(text=greeting_text, lang='en')
|
8 |
+
tts.save("greeting.mp3")
|
9 |
+
return "greeting.mp3"
|
10 |
+
|
11 |
+
# Create Gradio interface
|
12 |
+
iface = gr.Interface(
|
13 |
+
fn=greet,
|
14 |
+
inputs="text",
|
15 |
+
outputs="audio",
|
16 |
+
title="AI Voice Greeting",
|
17 |
+
description="Enter your name and receive a personalized greeting as an AI-generated voice."
|
18 |
+
)
|
19 |
+
|
20 |
+
# Launch the interface
|
21 |
+
iface.launch()
|