DEV Community 👩‍💻👨‍💻

Cover image for Text to Speech app with python
Kaveh Sabouri
Kaveh Sabouri

Posted on

Text to Speech app with python

Hello everyone today we want make text to speech app with python.

for this project we must install gtts module.

Write this in your terminal for install it:

pip install gtts
Enter fullscreen mode Exit fullscreen mode


from tkinter import *
from tkinter import messagebox
from gtts import gTTS

window = Tk()
window.title("Text to Speech")

def change():
    if entry.get() == "":
        messagebox.showerror("Error","No text to speak")
        messagebox.showinfo("Info","Please wait")
        speech = gTTS(text=entry.get())"speech.mp3")

label_welcome = Label(window,text="Text to speech",font=("Lalezar",40),fg="#E26D5C",bg="#C9CBA3")

entry = Entry(window)

button_change = Button(window,text="Change",bg="#E26D5C",command=change,font=("",20)),y=400)


Enter fullscreen mode Exit fullscreen mode

This is a output of project:

Image description

This application has been tested on Mac, and its appearance may change in Windows or Linux.

Thank you for reading this post.

Top comments (1)

udanielnogueira profile image
Daniel Nogueira

Good tutorial, I would like to more about Tkinter.

Let's Get Wacky

Use any Linode offering to create something unique or silly in the DEV x Linode Hackathon 2022 and win the Wacky Wildcard category

Join the Hackathon <-