Live Translations is a real-time multilingual transcription and translation service. It uses Google Cloud's Speech-to-Text, Translation, and Text-to-Speech APIs to transcribe and translate spoken language into multiple languages in real-time.
- Overview
- Features
- Installation
- Google Cloud Setup
- Usage
- Troubleshooting
- Contributing
- License
- Contact
- Real-time transcription and translation
- Supports multiple languages
- Noise reduction- Speaker diarization
- Python 3.7 or higher
- pip (Python package installer)
Before you install the dependencies, we recommend you to set up a Python virtual environment. This is an isolated environment where you can install Python packages without interfering with your system's Python setup. Here's how to set it up:
-
Open a terminal and navigate to the root folder of the project.
-
Run the following command to create a virtual environment named
venv
:python3 -m venv venv
This will create a new folder named
venv
in your project root directory. -
Activate the virtual environment:
-
On Windows, run:
.\venv\Scripts\activate
-
On Unix or MacOS, run:
source venv/bin/activate
When the virtual environment is activated, your terminal prompt will be prefixed with
(venv)
. -
If the requirements.txt
file doesn't exist in the project root directory, you can generate it. This file lists all the Python packages that your project depends on. Here's how to generate it:
-
Make sure you have activated your virtual environment and installed all the necessary packages.
-
Run the following command:
pip freeze > requirements.txt
This will create a requirements.txt
file and fill it with a list of all installed packages and their versions. This is useful for other developers who want to install all the project dependencies in one go.
With the virtual environment activated, you can now install the project dependencies. These are listed in the requirements.txt
file in the project root directory. To install them, run:
pip install -r requirements.txt
This will download and install all the required packages.
Remember to always activate the virtual environment before you start working on the project. When you're done, you can deactivate the virtual environment by simply running:
deactivate
-
Install the Google Cloud SDK following the instructions here.
-
Authenticate with Google Cloud:
gcloud auth login
-
Set up a Google Cloud project and enable the Speech-to-Text, Translation, and Text-to-Speech APIs.
-
Download your service account key as a JSON file and save it in the project directory.
-
Set the environment variable GOOGLE_APPLICATION_CREDENTIALS to the path of your service account key:
export GOOGLE_APPLICATION_CREDENTIALS="/path/to/your/service-account-file.json"
-
Start the server:
python server.py
-
Open your web browser and navigate to http://localhost:5000/controls.
-
From here you can style the translation pages to your liking. The changes do not reflect on the controls page.
-
Select your microphone and the languages you want to translate to, then click the "Start" button to start transcribing and translating.
-
Click any language tag in the supported languages section to open a new tab for that language.
If you encounter issues with the third-party packages used in this project, you can visit their respective support pages:
- Google Cloud SDK
- Google Cloud CLI
- Google Cloud Speech-to-Text
- Google Cloud Translation
- Google Cloud Text-to-Speech
- Flask
- Flask-SocketIO
- Eventlet
If you're still having trouble, feel free to open an issue on this repository.
Contributions are welcome! Please read the contributing guidelines first.
This project is licensed under the terms of the MIT license.
If you have any questions, feel free to contact me.