Skip to content

The Real-Time Speech Translation project demonstrates a Python application for real-time speech transcription and translation using machine learning and natural language processing (NLP) techniques. It provides a seamless interface for users to speak in one language and instantly see translations in English, enhancing multilingual communication

Notifications You must be signed in to change notification settings

AYUSHI-SHA/Speech_Translation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

Real-Time Speech Transcription and Translation

This project provides a simple Python application for real-time speech transcription and translation. It leverages the speech_recognition library for speech-to-text conversion and Google Translate for text translation into a target language.

Features

  • Real-time speech recognition using a microphone.

  • Transcription of spoken words into text in the source language.

  • Translation of transcribed text into a target language.

  • Support for multiple source and target languages.

Prerequisites

Ensure you have the following installed:

  1. Python 3.7+

  2. Libraries

  • speech_recognition

  • googletrans==4.0.0-rc1

Installation

  1. Clone the repository or download the script.

  2. Install the required Python libraries using pip: pip install speechrecognition googletrans==4.0.0-rc1

  3. Ensure your microphone is connected and accessible.

Usage

  1. Run the script:

    python speech.py

  2. Follow the prompts:

  • Enter the source language (e.g., English, Spanish, French, etc.).

  • Speak into your microphone to have your speech transcribed and translated in real-time.

  1. Press Ctrl+C to stop the application.

Example Run

Welcome to Real-Time Speech Translation!

Enter the source language (e.g., English, Spanish, French, German, etc.): English

Listening...

Recognized speech: Hello, how are you?

Translated text: Hola, ¿cómo estás?

Supported Languages

The application supports the following languages:

  • English

  • Spanish

  • French

  • German

  • Italian

  • Chinese

  • Hindi

  • Japanese

  • Korean

  • Portuguese

  • Russian

  • Bengali

  • Marathi

  • Gujarati

  • Kannada

Code Overview

get_language_code(language_name)

  • Maps common language names to their respective language codes.

  • Returns the language code for use in speech recognition and translation APIs.

transcribe_and_translate_realtime(source_language, target_language)

  • Uses the speech_recognition library to capture speech from a microphone.

  • Transcribes the speech into text using Google Web Speech API.

  • Translates the transcribed text to the target language using Google Translate.

  • Continuously listens for speech until interrupted.

Error Handling

  • Unknown Speech: If the Google Web Speech API cannot understand the input, the application will notify the user.

  • API Errors: If there's an issue with the speech recognition API, an error message will be displayed.

Future Improvements

  • Add support for custom target languages specified by the user.

  • Improve error handling for network or API issues.

  • Allow dynamic adjustment of microphone sensitivity.

Enjoy using the Real-Time Speech Transcription and Translation application!

About

The Real-Time Speech Translation project demonstrates a Python application for real-time speech transcription and translation using machine learning and natural language processing (NLP) techniques. It provides a seamless interface for users to speak in one language and instantly see translations in English, enhancing multilingual communication

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages