Oh Snap!

Please turnoff your ad blocking mode for viewing your site content

Hit enter after type your search item

Python Tkinter Text to Audio GUI App Using GTTS Library Full Tutorial


Welcome Folks today in this blog post I will be talking about how to convert text to audio using gtts library in a gui application using tkinter library in python. Let’s get started step by step in the youtube video as follows.

READ  PyInstaller Tutorial to Convert Python Scripts (.py) to .EXE Files Full Tutorial




pip install tkinter



pip install gtts


Now after installing these two libraries copy paste the following code to make this application. In this block of code we will be making the gui application using tkinter and then writing the code to convert the text written to a audio file and play the audio file also. For Playing the audio file we will be installing another library called PlaySound.

READ  Python Tutorial Compressing and Extracting Files Using ZipFile Library Full Project


pip install playsound


from tkinter import *

from gtts import gTTS 

from playsound import playsound

def convert_audio():
    address_info = address.get()
    language = 'en'
    myobj = gTTS(text=address_info, lang=language, slow=False)

app = Tk()


app.title("Python Text to Audio App")

heading = Label(text="Python Text to Audio",bg="yellow",fg="black",font="10",width="500",height="3")


address_field = Label(text="Text :")


address = StringVar()

address_entry = Entry(textvariable=address,width="30")


button = Button(app,text="Convert to Audio",command=convert_audio,width="30",height="2",bg="grey")




READ  Python OpenCV Tutorial To Capture Images From Webcam Full Project



Leave a Comment

Your email address will not be published. Required fields are marked *

This div height required for enabling the sticky sidebar
Ad Clicks : Ad Views : Ad Clicks : Ad Views : Ad Clicks : Ad Views : Ad Clicks : Ad Views : Ad Clicks : Ad Views : Ad Clicks : Ad Views : Ad Clicks : Ad Views : Ad Clicks : Ad Views : Ad Clicks : Ad Views : Ad Clicks : Ad Views : Ad Clicks : Ad Views : Ad Clicks : Ad Views :