# Repository Briefing: R3gm/SoniTranslate
> Source: https://repoforai.com/repo/R3gm/SoniTranslate (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/R3gm/SoniTranslate
- **Category**: Voice, Vision & Video (语音 / 视觉 / 视频生成)
- **Primary Language**: Python
- **License**: Apache-2.0
- **Engineering Health**: B+ (64/100 · Maintenance 12/35 · Adoption 21/25 · Releases 11/20 · License 20/20)
- **Latest Release**: 0.5.0 (2024-05-18) — https://github.com/R3gm/SoniTranslate/releases
- **Review Snapshot**: 2026-12-03
- **Deployment / Stack Signals**: Self-Hosted, GPU
- **Momentum**: 1,435 ★ total (+0 24h / +1 7d) · 360 forks
- **Topics**: `asr`, `audio-processing`, `automatic-dubbing`, `diarization`, `document-translator`, `dubbing`, `speech-to-text`, `stt`, `subtitle-to-speech`, `text-to-speech`, `translate-audio`, `translate-video`
- **When to Use**: Best for: Localization teams and creators dubbing recorded training, interviews, or educational videos who want to review translated subtitles, assign voices by speaker, and export editable assets alongside the finished video. Skip if: You need live interpretation, a turnkey managed service, or an offline deployment without time to stage and validate every backend. If you only need an aligned transcript, use a dedicated ASR tool.

## Overview
```text
### Architecture & Core Mechanics
SoniTranslate is a Python application for offline-in-time media dubbing, not live interpretation. `app_rvc.py` launches the Gradio UI. FFmpeg handles media processing, and yt-dlp provides URL ingestion. WhisperX transcribes speech and aligns it to timestamps; pyannote assigns speaker labels to time spans. Translated segments can then be edited before synthesis, and the dubbed speech is placed back on the media timeline for export.

The manifests include PyTorch CUDA wheels, ONNX Runtime GPU, `deep_translator`, `edge_tts`, and `gTTS`; the project also offers optional Piper and XTTS installs. The integration points exposed to users are stage-specific: enter a Hugging Face model ID for Whisper ASR, select voice backends, or configure optional OpenAI transcription, translation, and TTS. The concrete launch interface is Gradio; don't assume a stable headless API or distributed worker contract.

### Key Capabilities & Differentiators
Version 0.5.0 adds overlap reduction and pre-transcription vocal enhancement, useful controls when speakers talk over one another or the speech is hard to hear. TTS supports up to 12 speakers. Operators can edit translated subtitles before synthesis and adjust voice speed and volume. Language coverage varies by stage: English and Simplified and Traditional Chinese are listed for translation, while Aymara and Kurdish are listed without native transcription support. Check the source and target languages against the stages you actually need.

The app supports ASS subtitles and batch processing with subtitles, with outputs that include dubbed video, subtitles split by speaker, separate audio, and video with subtitles but no dub. RVC support was introduced in 0.4.0, and 0.5.0 integrates OpenVoiceV2 for voice imitation. The PDF-to-videobook path also displays the PDF's page images.

### Trade-offs & Limitations
Compared with running WhisperX on its own, SoniTranslate brings translation, subtitle correction, multi-speaker synthesis, and timed rendering into one operator workflow. The trade-off is a larger dependency graph: FFmpeg and model libraries are joined by optional voice stacks, and `requirements.txt` includes direct Git dependencies such as WhisperX and fairseq. Pin the revision and dependency set you validate instead of assuming that all install paths resolve identically.

Compared with a managed dubbing workflow, self-hosting gives you more control over model choice and deliverables, but puts runtime compatibility, GPU sizing, and credential handling on your team. Memory and processing time depend on chosen models, media length, and job concurrency; CPU mode is a fallback, not a throughput guarantee. External backends can add network, data-handling, and cost considerations. Apache-2.0 covers the repository code, not all model terms, API terms, or permissions to imitate a voice.

### Hardware & Deployment Guide
The local setup uses a Conda environment with Python 3.10 and specifies PyTorch 2.5.1, torchvision 0.20.1, torchaudio 2.5.1, and CUDA 11.8 on a compatible NVIDIA host. Install `requirements_base.txt`, `requirements_extra.txt`, and `onnxruntime-gpu`, and put FFmpeg on `PATH`. For gated pyannote models, accept the Hugging Face access terms and set `YOUR_HF_TOKEN`. Set `OPENAI_API_KEY` only if you intend to use the OpenAI-backed stages.

Launch with `python app_rvc.py` and open `http://127.0.0.1:7860`. Colab is an alternative for evaluation. Version 0.5.0 (May 18, 2024) adds `--cpu_mode` and expands export options. Keep the UI local by default for sensitive media: `--public_url` enables a public link. Self-hosting does not make the pipeline offline; for an offline deployment, provision required model assets in advance and verify that every selected stage runs without a network connection.
```

## Key Capabilities
```text
- Media pipeline: Gradio front end, WhisperX transcription and timestamp alignment, pyannote speaker diarization, and FFmpeg rendering.
- Speaker handling: Up to 12 speakers in TTS, with overlap reduction and subtitles split by speaker.
- Timeline editing: Revise translated subtitles before synthesis, adjust voice speed and volume, and batch-process media with subtitles.
- Voice backends: Optional local Piper and XTTS, OpenVoiceV2 voice imitation, and optional OpenAI transcription, translation, and TTS.
- Deliverables: Dubbed video, separate audio, subtitle-only video, ASS subtitle support, and PDF videobooks that display page images.
- Runtime: CUDA 11.8 PyTorch setup, optional `--cpu_mode`, and a Colab notebook for evaluation.
```

## Quick Start / Clone
```bash
pip install -r requirements_base.txt -v
pip install -r requirements_extra.txt -v
pip install onnxruntime-gpu
```
