This is a web-based application that allows users to record audio, transcribe the speech, and translate it into a specified language using AssemblyAI for transcription and Groq's API for translation. The application is built using Flask for the backend and JavaScript for the frontend.
- Record audio in the browser
- Upload recorded audio to the server
- Transcribe audio using AssemblyAI
- Translate transcriptions using Groq API
- Play back the recorded audio
- Responsive UI with a gradient background
- HTML, CSS (Gradient UI)
- JavaScript (MediaRecorder API, Fetch API)
- Flask (Python Web Framework)
- AssemblyAI (Speech-to-Text API)
- Groq API (Translation Service)
- dotenv (Environment Variable Management)
- uuid (Unique File Naming)
- Python 3.x
- Pip
- Virtual environment (optional but recommended)
- AssemblyAI API key
- Groq API key
-
Clone the repository:
git clone https://github.com/your-repo/audio-translator.git cd audio-translator -
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Create a
.envfile and add your API keys:GROQ_API_KEY=your_groq_api_key api_key=your_assemblyai_api_key
-
Run the Flask application:
python app.py
-
Open your browser and go to:
http://127.0.0.1:5000/
- Serves the frontend UI.
- Uploads an audio file, transcribes it, and translates it.
- Request Body: FormData with an
audiofile. - Response:
{ "message": "Transcription result", "original_text": "Original transcription", "translated_text": "Translated text", "file_path": "path/to/audio/file" }
- Serves the recorded audio file for playback.
- Browser compatibility issues with MediaRecorder API (works best on Chrome & Edge).
- Only supports selected languages in the translation dropdown.
- Add support for more languages.
- Improve UI with better error handling and loading indicators.
- Allow users to download transcribed and translated text.
This project is licensed under the MIT License.