Text to Speech in Python using Google Text-to-Speech API


Hey People,

Can we make our computer-speak, with Python? I know you got it, Text-to-Speech absolutely.
Speech synthesis is the artificial production of human speech. In simple words,
when given a string of text, the computer will speak the written words.

Text to Speech in Python using Google Text-to-Speech API

A lot of APIs are available to convert text to speech in Python. For example, gTTS text to speech, Microsoft speech engine, IBM Watson TTS etc.  Google Text to Speech API commonly known as the gTTS API seems to be the best among them. It is a very simple and clean tool that converts a text into audio, which can be saved as an mp3 file.

gTTS(Google Text-to-Speech), is a Python library and CLI tool to interface with Google Translate’s text-to-speech API that can be used to convert spoken text to mp3. This module supports many languages and sounds very natural.

  • Installation:
          pip install gTTS

Here is a simple Python program that converts text to speech.


text-to-speech_python.py


Thanks and have a great day.
Text to Speech in Python using Google Text-to-Speech API Text to Speech in Python using Google Text-to-Speech API Reviewed by Cyril Tom Mathew on July 21, 2019 Rating: 5

No comments:

Powered by Blogger.