Hello programmers welcome to coderzway today I am going to show how to make text to speech converter in python yeah we will create our own text to speech program you don’t download any applications to convert your text to voice.
There are many ways of doing this in python but I am going to show you the most easy and simple way we will use the pyttsx3 python library for audio converting in our text to speech program.
It is very simple project the user will enter the text they want to convert then the voice will be converted into male robot and it will be saved in your computer you see you can easily convert text to speech in python.
You can also use female robot voice and change the speed of the robot you can customise and create a application from this it depends on your creativity.
If you want more coding projects than you should visit coderzway projects there we upload daily cool projects with source code you can go coderzway projects page here.
Making a text to speech converter in python
So first thing you need to have on your computer or laptop is python installed if you don’t have python installed go to python website and download and install remember to click add python to path while installing.
To download python go to the python official website here – download python.
Create a python file
Now go to any folder and open it in vs code or any code editor and create a python file with .py extension.
To download vs code go to this website – download vs code.
Now you have created the python file now open a terminal or command prompt at the file location and install pyttsx3 to install it paste or type the below command
pyttsx3 is a python library which is going to help us to convert text to speech in python this is a great and small library
Copy and paste python code
After copying and pasting the code run the file
To run the file type or paste the following command in the terminal or command prompt at the file location
This will run the file you should see this as output
First it will ask you to enter the text you want to convert to speech than it will ask you to enter the name of audio file you want to save as don’t name existing file name this will overide it.
So this was the project on how to make text to speech converter in python it was a simple and easy project you can expand upon it by making voice assistant and more.
I hope you found this article helpful and if loved this and want more projects like this than do subscribe to our newsletter and share it with your friends and family thank you have a nice day.