Convert audio or video into accurate SRT subtitles using Wit.ai and webrtcvad. Supports Arabic & Darija (Moroccan Arabic), with automatic speech segmentation, proper timestamps, and JSON export. Perfect for generating captions, transcripts, and multilingual subtitle workflows.
# Wit.ai SRT Transcriber
This project provides a command-line tool to transcribe audio/video into **SRT subtitles** using Wit.ai.
## Features
- Converts any audio/video file to 16kHz WAV (via ffmpeg)
- Uses webrtcvad for voice activity detection
- Splits audio into speech segments and sends them to Wit.ai
- Outputs both `.srt` subtitle file and `.json` log
## Requirements
- Python 3.8+
- ffmpeg installed and available in PATH
Install dependencies:
```bash
pip install -r requirements.txt
```
## Usage
1. Set your Wit.ai server token in environment:
```bash
cp .env.example .env
# edit .env with your Wit token
export $(cat .env | xargs) # load into environment
```
2. Run transcription:
```bash
python src/main.py path/to/audio.wav --srt out.srt --json out.json
```
## Env vars
- `WIT_TOKEN` = "Bearer YOUR_WIT_SERVER_TOKEN"
## Output
- `*_wit.srt`: subtitle file with proper timestamps
- `*_wit.json`: raw data (segment text + Wit response)