In this project our goal is to acheive the problem of converting textual data into speech data.
As we know, some people have difficulty reading large amounts of text due to dyslexia and other learning disabilities. Some people have basic literary levels. They often get frustrated trying to browse the internet because so much of it is in text form or on other hand some people prefer to listen or watch a news article (or something like this) instead of reading. So to solve all these problems a concept comes into mind that is ”text to speech”. Text-to-speech (TTS) technology reads aloud digital text. It can take words on computers, smartphones, tablets and convert them into audio. We will be using Google Text to Speech commonly known as the gTTS API. It is very easy to use the library which converts the text entered, into an audio file which can be saved as a mp3 file. It supports several languages and the speech can be delivered in any one of the two available audio speeds, fast or slow.
Here we will be using Anaconda Python 3.6 and GTTS.
Installation of this project is pretty easy. Please do follow the following steps to create a virtual environment and then install the necessary packages in the following environment.
In Pycharm it’s easy
- Create a new project.
- Navigate to the directory of the project
- Select the option to create a new new virtual environment using conda with python3.6
- Finally create the project using used resources.
- After the project has been created, install the necessary packages from requirements.txt file using the command
pip install -r requirements.txt
In Conda also it’s easy
- Create a new virtual environment using the command conda create -n your_env_name python=3.6
- Navigate to the project directory.
- Install the necessary packages from requirements.txt file using the command
pip install -r requirements.txt
TESTING IN LOCAL/API To run this project in your local system just run the file app.py as follows,
set FLASK_APP = app.py
then after successful excution, type
flask run
and webserver will start and landing page will open at http://127.0.0.1:5000/
Write the content in text box and get the audio on right side.
Hence we have successfully converted digital text data data in audio data or speech.
Here we can improve the results by testing with other APIs which are available from diffrent third party sources or try out deep learning approaches.