aisys / app.py
saiyadri's picture
Update app.py
1755bb4
raw
history blame contribute delete
479 Bytes
import gradio as gr
import pyttsx3
# Initialize the text-to-speech engine
engine = pyttsx3.init()
# Define a function to handle the button click event
def speak(text):
# Set the text to be spoken
engine.say("hello how are you?")
# Wait for the speech to finish
engine.runAndWait()
# Create a Gradio interface with a button
iface = gr.Interface(fn=speak, inputs="text", outputs=None, live=True, button="Speak")
# Launch the Gradio interface
iface.launch()