This is a web application that provides real-time speech and text translation. It combines a Python backend using the Flask framework with a JavaScript frontend to capture audio, translate spoken words into text, and display the results.
- Real-time Speech-to-Text: Captures audio input from a microphone and converts it into text.
- Live Text Translation: Translates the recognized text into another language.
- Web-based Interface: A user-friendly, responsive interface built with HTML, CSS, and JavaScript.
- Modular Design: The project is organized into separate files for different functionalities, such as speech processing (
speech.py), translation (translate.py), and the main application logic (app.py).
- Python: The core language for the backend.
- Flask: A micro web framework for the backend server.
- SpeechRecognition: A library to perform speech recognition with support for various engines and APIs.
- Googletrans: A Python library for translating text using the Google Translate API.
- JavaScript: The scripting language for the frontend, handling user interactions and API calls.
- HTML & CSS: Used to structure and style the web application's interface.
You need Python 3.x and pip installed on your system.
-
Clone the repository:
git clone [https://github.com/YOUR_USERNAME/your-repo-name.git](https://github.com/YOUR_USERNAME/your-repo-name.git) cd your-repo-name -
Set up the Python environment: It's recommended to create a virtual environment.
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install the necessary Python libraries:
pip install Flask SpeechRecognition googletrans==4.0.0-rc1
Note: The specific version of
googletransis recommended for stability.
- Run the Flask application:
python app.py
- Access the web application:
Open your web browser and navigate to
http://127.0.0.1:5000. The interface will be displayed, and you can begin speaking into your microphone to see the real-time translation.
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! If you find a bug or have an idea for an improvement, please open an issue or submit a pull request.
Note: This project relies on external APIs (like Google Translate), so an active internet connection is required for full functionality.