# Amharic Real-Time Translator
A real-time speech-to-text and translation system for Amharic language, designed to transcribe and translate conversations from Google Meet or microphone input into English.
## 🎯 Features
- **Real-time Amharic transcription** using state-of-the-art Wav2Vec2 models
- **Automatic English translation** via Google Translate
- **Multiple input sources:**
- Desktop audio capture (Stereo Mix) for Google Meet calls
- Microphone input for direct speech
- Phone microphone via web interface
- **Dual interfaces:**
- Desktop overlay with Pygame for local use
- Web-based interface for remote/mobile access
- **Advanced audio processing:**
- Silence detection and speech thresholding
- Adjustable input gain (1x-5x)
- Dynamic buffer management
- **Three AI model options** with automatic fallback
## 🚀 Quick Start
# Python 3.12 recommended
conda create -n amharic_translator python=3.12
conda activate amharic_translator
# Install dependencies
```
pip install torch torchvision torchaudio --index-url
download.pytorch.org
pip install transformers deep-translator scipy pygame flask flask-socketio pyaudio
```
### Desktop Mode (Capture System Audio)
```bash
# Capture desktop audio (e.g., Google Meet)
python main.py --desktop
```
This will:
1. Load the Wav2Vec2 Amharic model (~1.2GB on first run)
2. Capture audio from Stereo Mix/Desktop Audio
3. Display transcriptions in a Pygame overlay window
### Microphone Mode (Direct Speech)
```bash
# Capture from microphone
python main.py --mic
```
### Web/Phone Interface
```bash
# Start the web server
python server.py
```
Then:
- **On PC:** Open `
localhost`
- **On Phone:** Open `
your_pc_ip`
**Phone Setup (Android Chrome):**
1. Go to `chrome://flags`
2. Search "Insecure origins treated as secure"
3. Add `
your_pc_ip`
4. Enable and relaunch Chrome
## 📱 Web Interface Features
- **Microphone selector** - Choose between phone mics (bottom/top/external)
- **Vo …