Coders Packet

Voice Translator using Python

By Sayak Mandal

First recognize the voice after recognize this converted to another language and the converted language is in text format, and after that this text is converted to speech.

A voice translator is a packet using Python that uses various Python libraries to convert any language to another any languages, then the translated language's output is in text format and last the text is converted into speech. This application can convert any language to another language. Here I show the conversion of English to Hindi. If you want to convert any language to another language then just change the language in the source code. After running the code you speak, the application recognizes the speech and converts it into another language's speech. Before running the code, some library must be installed in your system. The prerequisites are mentioned below.

Prerequisites:

1.pyttsx3 module: 

To install the module use the pip install pyttsx3  command.

After installing this module, we can import the pyttsx3 module using import pyttsx3 .

Python Text-to-Speech version 3 ( pyttsx3 ) is a python library that basically use to convert text to speech. We provide text and pyttsx3 module convert into speech. The module has two supported voices - a male voice and a female voice. 

This module includes three Text-to-Speech engines:

  • sapi5 – sapi5 provides both male and female voices. It is specifically for windows.
  • nsss – nsss provides both male and female voices. It is specifically used for MAC-OS.
  • espeak – espeak provides both male and female voices. It is primarily used for Linux.

All these three are used to convert text to speech.

2. speech_recognition module: 

 To install the module use pip install SpeechRecognition command.

After installing this module we can import using import speech_recognition.

This is a python library. Computers understand human speech for this module. The goal of this module is to convert speech to text form and basically, it is used to recognize human speech using a microphoone and convert the speech to writable format.

3. googletrans module:

To install the module use pip install googletrans command.

After installing this module we can import the module using from googletrans import Translator command.

This module is used for language translation using Google Translate API. Basically, this module is used to translate any language that is in text form, to another language. This module is depending upon Google Translate API that's why it is not working without an internet connection, so make sure that internet connection is on.

I implement this project step by step. It converts any language to another language. You just change the language name during compile time.  

Output: 

 

Download Complete Code

Comments

No comments yet

Download Packet

Reviews Report

Submitted by Sayak Mandal (Sayak)

Download packets of source code on Coders Packet