Skip to content

bedouhammad/dubbing-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🎙️ Arabic Dubbing Demo

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.


🚀 What It Does

This project takes an English audio file and produces a fully dubbed Arabic version through a multi-stage pipeline:

  1. Transcription — Converts English speech to text using Whisper
  2. Translation — Translates the transcript to Arabic
  3. Tashkeel (Diacritization) — Adds Arabic diacritics for accurate pronunciation
  4. Text-to-Speech — Synthesizes natural Arabic audio using Edge TTS with two-speaker support

🗂️ Project Structure

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

🛠️ Tech Stack

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

⚙️ Setup & Installation

# 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.txt

▶️ How to Run

Full pipeline demo:

python make_dialogue_demo.py

Step 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

🎧 Example Output

  • Input: demo.wav — English audio
  • Output: final_demo_arabic.wav — Dubbed Arabic audio with two speakers

📌 Notes

  • 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

👤 Author

Abdelrahman Hammad
GitHub @bedouhammad

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages