An end-to-end AI-powered pipeline that automatically transcribes English audio, translates it to Arabic, and generates dubbed Arabic audio — complete with two-speaker voice synthesis.
This project takes an English audio file and produces a fully dubbed Arabic version through a multi-stage pipeline:
- Transcription — Converts English speech to text using Whisper
- Translation — Translates the transcript to Arabic
- Tashkeel (Diacritization) — Adds Arabic diacritics for accurate pronunciation
- Text-to-Speech — Synthesizes natural Arabic audio using Edge TTS with two-speaker support
dubbing_demo/
│
├── transcribe.py # Transcribe audio to English text
├── transcribe_all_demo.py # Batch transcription
├── transcribe_chunks.py # Chunk-based transcription
├── transcribe_en.py # English-specific transcription
│
├── translate.py # Core translation script
├── translate_to_ar.py # Translate English text to Arabic
├── translate_dialogue_to_ar.py # Dialogue-aware translation
├── fix_translation.py # Post-process and fix translations
│
├── tashkeel_ar.py # Arabic diacritization
│
├── tts_ar.py # Arabic TTS (base)
├── tts_ar_edge.py # Arabic TTS using Edge TTS
├── tts_ar_edge_male.py # Male voice TTS
├── tts_ar_two_speakers_edge.py # Two-speaker Arabic dubbing
│
├── make_dialogue_demo.py # Full pipeline demo runner
│
├── demo.wav # Sample input audio
├── transcript.txt # Generated transcript
├── translated.txt # Generated Arabic translation
├── final_demo_arabic.wav # Final dubbed Arabic output
│
├── input/ # Input audio files
├── tts_out/ # TTS output audio files
├── work/ # Intermediate working files
└── piper_voices/ # Local TTS voice models
| Tool | Purpose |
|---|---|
| OpenAI Whisper | Speech-to-text transcription |
| Microsoft Edge TTS | Neural Arabic voice synthesis |
| Piper TTS | Local offline TTS engine |
| Python 3 | Core language |
# Clone the repository
git clone https://github.com/bedouhammad/dubbing-demo.git
cd dubbing-demo
# Create and activate virtual environment
python3 -m venv venv
source venv/bin/activate
# Install dependencies
pip install -r requirements.txtFull pipeline demo:
python make_dialogue_demo.pyStep by step:
# Step 1: Transcribe
python transcribe.py
# Step 2: Translate to Arabic
python translate_to_ar.py
# Step 3: Generate dubbed audio
python tts_ar_two_speakers_edge.py- Input:
demo.wav— English audio - Output:
final_demo_arabic.wav— Dubbed Arabic audio with two speakers
- This is a local demo pipeline built and tested on macOS
- Arabic diacritization (
tashkeel) is applied before TTS for more natural pronunciation - Two-speaker mode simulates dialogue dubbing with distinct male/female voices
Abdelrahman Hammad
GitHub @bedouhammad