Synchronized Translation for Videos. Video dubbing
Synchronized Translation for Videos. Video dubbing
If you’re looking for a meeting transcription API, consider checking out Recall.ai, an API that records Zoom, Google Meet, Microsoft Teams, in-person meetings, and more.
SonyTranslate is a powerful and user-friendly web application that allows you to easily translate videos into different languages. This repository hosts the code for the SonyTranslate web UI, which is built with the Gradio library to provide a seamless and interactive user experience.
| Description | Link |
|---|---|
| Colab Notebook | |
| Repository | |
| Online DEMO |
For a comprehensive understanding of the project, we highly recommend watching this video tutorial by DEV-MalletteS. You can watch it on YouTube by clicking the thumbnail below:
| Language Code | Language |
|---|---|
| en | English |
| fr | French |
| de | German |
| es | Spanish |
| it | Italian |
| ja | Japanese |
| nl | Dutch |
| uk | Ukrainian |
| pt | Portuguese |
| ar | Arabic |
| zh | Chinese - Simplified |
| zh-TW | Chinese - Traditional |
| cs | Czech |
| da | Danish |
| fi | Finnish |
| el | Greek |
| he | Hebrew |
| hu | Hungarian |
| ko | Korean |
| fa | Persian |
| pl | Polish |
| ru | Russian |
| tr | Turkish |
| ur | Urdu |
| hi | Hindi |
| vi | Vietnamese |
| id | Indonesian |
| bn | Bengali |
| te | Telugu |
| mr | Marathi |
| ta | Tamil |
| jw (or jv) | Javanese |
| ca | Catalan |
| ne | Nepali |
| th | Thai |
| sv | Swedish |
| am | Amharic |
| cy | Welsh |
| hr | Croatian |
| is | Icelandic |
| ka | Georgian |
| km | Khmer |
| sk | Slovak |
| sq | Albanian |
| sr | Serbian |
| az | Azerbaijani |
| bg | Bulgarian |
| gl | Galician |
| gu | Gujarati |
| kk | Kazakh |
| kn | Kannada |
| lt | Lithuanian |
| lv | Latvian |
| ml | Malayalam |
| ro | Romanian |
| si | Sinhala |
| su | Sundanese |
| et | Estonian |
| mk | Macedonian |
| sw | Swahili |
| af | Afrikaans |
| bs | Bosnian |
| la | Latin |
| my | Myanmar Burmese |
| no | Norwegian |
| as | Assamese |
| eu | Basque |
| ha | Hausa |
| ht | Haitian Creole |
| hy | Armenian |
| lo | Lao |
| mg | Malagasy |
| mn | Mongolian |
| mt | Maltese |
| pa | Punjabi |
| ps | Pashto |
| sl | Slovenian |
| sn | Shona |
| so | Somali |
| tg | Tajik |
| tk | Turkmen |
| tt | Tatar |
| uz | Uzbek |
| yo | Yoruba |
| Language Code | Language |
|---|---|
| ay | Aymara |
| bm | Bambara |
| ceb | Cebuano |
| ny | Chichewa |
| dv | Divehi |
| doi | Dogri |
| ee | Ewe |
| gn | Guarani |
| ilo | Iloko |
| rw | Kinyarwanda |
| kri | Krio |
| ku | Kurdish |
| ky | Kirghiz |
| lg | Ganda |
| mai | Maithili |
| or | Oriya |
| om | Oromo |
| qu | Quechua |
| sm | Samoan |
| ti | Tigrinya |
| ts | Tsonga |
| ak | Akan |
| ug | Uighur |
https://github.com/R3gm/SoniTranslate/assets/114810545/db9e78c0-b228-4e81-9704-e62d5cc407a3
https://github.com/R3gm/SoniTranslate/assets/114810545/6a8ddc65-a46f-4653-9726-6df2615f0ef9
To run SoniTranslate using Colab Runtime:
Before you start installing and using SoniTranslate, there are a few things you need to do:
accept the license to use the models: https://huggingface.co/pyannote/speaker-diarization and https://huggingface.co/pyannote/segmentationconda install -c anaconda git -y in your terminal (Do this after step 1 in the following section.). If you have trouble installing Git via Anaconda, you can use the following link instead:
Once you have completed these steps, you will be ready to install SoniTranslate.
To install SoniTranslate, follow these steps:
conda create -n sonitr python=3.10 -y
conda activate sonitr
python -m pip install pip==23.1.2 Setuptools==80.6.0
conda install pytorch==2.5.1 torchvision==0.20.1 torchaudio==2.5.1 pytorch-cuda=11.8 -c pytorch -c nvidiagit clone https://github.com/r3gm/SoniTranslate.git
cd SoniTranslatepip install -r requirements_base.txt -v
pip install -r requirements_extra.txt -v
pip install onnxruntime-gpuInstall ffmpeg. FFmpeg is a free software project that produces libraries and programs for handling multimedia data. You will need it to process audio and video files. You can install ffmpeg with Anaconda by running conda install -y ffmpeg in your terminal (recommended). If you have trouble installing ffmpeg via Anaconda, you can use the following link instead: (https://ffmpeg.org/ffmpeg.html). Once it is installed, make sure it is in your PATH by running ffmpeg -h in your terminal. If you don't get an error message, you're good to go.
Optional install:
After installing FFmpeg, you can install these optional packages.
Piper TTS is a fast, local neural text to speech system that sounds great and is optimized for the Raspberry Pi 4. Piper is used in a variety of projects. Voices are trained with VITS and exported to the onnxruntime.
pip install -q piper-tts==1.2.0Coqui XTTS is a text-to-speech (TTS) model that lets you generate realistic voices in different languages. It can clone voices with just a short audio clip, even speak in a different language! It's like having a personal voice mimic for any text you need spoken.
pip install -q -r requirements_xtts.txt
pip install -q TTS==0.21.1 --no-depsTo run SoniTranslate locally, make sure the sonitr conda environment is active:
conda activate sonitrSetting your Hugging Face token as an environment variable in Linux:
export YOUR_HF_TOKEN="YOUR_HUGGING_FACE_TOKEN"Then navigate to the SoniTranslate folder and run either the app_rvc.py
python app_rvc.pyWhen the local URL http://127.0.0.1:7860 is displayed in the terminal, simply open this URL in your web browser to access the SoniTranslate interface.
In most environments, you can stop the execution by pressing Ctrl+C in the terminal where you launched the script app_rvc.py. This will interrupt the program and stop the Gradio app.
To deactivate the Conda environment, you can use the following command:
conda deactivateThis will deactivate the currently active Conda environment sonitr, and you'll return to the base environment or the global Python environment.
If you need to start over from scratch, you can delete the SoniTranslate folder and remove the sonitr conda environment with the following set of commands:
conda deactivate
conda env remove -n sonitrWith the sonitr environment removed, you can start over with a fresh installation.
conda activate sonitr
conda env config vars set YOUR_HF_TOKEN="YOUR_HUGGING_FACE_TOKEN_HERE"
conda deactivateconda activate sonitr
conda env config vars set OPENAI_API_KEY="your-api-key-here"
conda deactivateThe app_rvc.py script supports command-line arguments to customize its behavior. Here's a brief guide on how to use them:
| Argument command | Default | Value | Description |
|---|---|---|---|
| --theme | Taithrah/Minimal | String | Sets the theme for the interface. Themes can be found in the Theme Gallery. |
| --language | english | String | Selects the interface language. Available options: afrikaans, arabic, azerbaijani, chines |
No open issues yet, or sync has not completed.