dds / app.py
sikandarciv101's picture
Update app.py
2bad18d verified
raw
history blame contribute delete
481 Bytes
import gradio as gr
from gtts import gTTS
import os
def text_to_speech(text):
# Convert text to speech
tts = gTTS(text=text, lang='en')
tts.save("output.mp3")
return "output.mp3"
# Create Gradio interface
iface = gr.Interface(fn=text_to_speech,
inputs="text",
outputs="audio",
title="Text to Speech",
description="Enter text, and the system will read it aloud.")
iface.launch()