Professional Documents
Culture Documents
ID NUMBER: ADS18A00095Y
TOPIC: DEVELOPING AN EXPERT SYSTEM TO CONVERT TEXT TO SPEECH USING
PYTHON.
The main objective of this project is to convert the text into voice with the click of a button. This
project will be developed using Tkinter, gTTs, and playsound library. With this project, we add a
message which we want to convert into voice and click on play button to play the voice of that
text message.
1. We begin this project by importing the needed libraries which are tkinter, gTTS, and
playsound
[from tkinter import *
Label() widget is put in place to display one or more than one line of text that users can’t able to
modify.
3. With this step we create the function to convert text to speech in python.
[ def Text_to_speech():
Message = entry_field.get()
speech = gTTS(text = Message)
speech.save('DataFlair.mp3')
playsound('DataFlair.mp3') ]
Message variable will contain the value of entry_field
text is the sentences or text to be read.
lang takes the language to read the text. The default language is English.
slow use to reads text more slowly. The default is False.
As we want the default value of lang, so no need to give that to gTTS.
Summary
We have developed the text to speech python project. We used the common tkinter library for
rendering graphics on a display window, gTTs (google text to speech) library to convert text to
voice, and playsound library to play that converter voice from the text.