This project uses artificial intelligence to transcribe an audio file in Spanish, translate it into several languages (English, Italian, French, and Japanese), and convert the translations into audio files. It is built using Gradio, Whisper, and the ElevenLabs API.
Obtain your ElevenLabs API key and replace "Your ElevenLabs API key here" in the file with your generated key from ElevenLabs .
Ensure you have the Wisper model and the necessary libraries installed.
The main workflow of the application is as follows:
Transcription:
The user records or uploads an audio file in Spanish.Translation:
The transcribed text is translated into English, Italian, French, and Japanese.Audio Conversion:
The translations are converted into audio files and returned to the user.
translator(audio_file):
Main function that handles the transcription and translation of the audio.text_to_speach(text, language):
Converts text to speech using the ElevenLabs API.
If you want to virtualize your Python environment, follow the instructions for your operating system below.
-
Open your terminal.
-
Navigate to your project directory:
$ cd /path/to/your/project
-
Create a virtual environment:
$ python3 -m venv venv
-
Activate the virtual environment:
$ source venv/bin/activate
-
To deactivate the virtual environment, simply run:
$ deactivate
-
Open your terminal.
-
Navigate to your project directory:
$ cd C:\path\to\your\project
-
Create a virtual environment:
$ python3 -m venv venv
-
Activate the virtual environment:
$ venv\Scripts\activate
-
To deactivate the virtual environment, simply run:
$ deactivate
-
Open your terminal.
-
Navigate to your project directory:
$ cd C:\path\to\your\project
-
Create a virtual environment:
$ python3 -m venv venv
-
Activate the virtual environment:
$ source venv/bin/activate
-
To deactivate the virtual environment, simply run:
$ deactivate
Make sure you have the following Python packages installed:
gradio
whisper
translate
elevenlabs
ELEVENLABS_API_KEY = "Your ElevenLabs API key here"
$ pip install gradio whisper translate elevenlab
Contributions are welcome. Feel free to open an issue or submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for more details.