Skip to content

SuhasBRao/Text-To-Speech

Repository files navigation

<style> .btn { background-color: DodgerBlue; border: none; color: white; padding: 5px 10px; font-size: 16px; cursor: pointer; } /* Darker background on mouse-over */ .btn:hover { background-color: RoyalBlue; } </style> home arrow_back_ios arrow_forward_ios

Text-To-Speech

Description


The project aims to convert text to speech. This is achieved using gTTS engine which has very natural sounding voices. Python language has been used. Python allows us to write a neat and simple code to complete the work. Here the user needs to be connected to the internet while running the .py file. Here the .py script first asks the user to input the sentence to be read/Converted to speech, then it creates a .mp3 file using gTTS. This file is then read using playsound module in python. Though it looks like a simple task, a lot is happening in the background.

Uniqueness


There are plenty of websites available on the internet that show how to convert text to speech using python. This code has been taken from the internet and has been modified for my purpose.

How to run the script

  • Go to the repository here.
  • Download the code/ copy the code from text_to_speech.py
  • Make sure you have installed gTTS and playsound libraries.
  • Then run txt_to_speech.py.
  • Enter the sentence to be converted to speech.

NOTE : Before running the script make sure you are connected to the internet.