Program for voice dubbing with TTS (native or online) video from SRT subtitles, lightweight without heavy dependencies, both for Windows and GNU/Linux (Debian, Ubuntu etc)
Allows subtitles to be transformed into audio while respecting timestamps and then perform quick dubbing into another language.
You can also set various parameters including maximum or minimum speed so that you always have a good listening experience.
It will strictly respect the subtitle timestamps if you want it to.
The offline version uses the native tts of the operating system you are using, on linux it uses the preinstalled "espeak" but since it sounds bad I recommend using the online version, while for windows it is fine and you can also install nicer voices from third party companies
FFMPEG installed in the system or portable. If portable, copy the executables:
for linux to ../pySubTTS/ffmpeg/ubuntu/ffmpeg/ffmpeg
for windows ..\pySubTTS\ffmpeg\windows\ffmpeg.exe
For both operating systems (on linux the installer takes care of it):
pip install pyttsx3 PyQt5 srt chardet pydub edge-tts
On linux if you used the installer you will find it in the main menu.
If you want to start it manually type in the terminal
python3 pySubTTS.py
On windows just make two clicks on "RunWindows.bat" or in Italian "AvviaWindows.bat"
If you want to start it manually type in the cmd
python pySubTTS.py
You can change a few variables:
- use ffmpeg portable
ffmpegportable = "yes"
- see detailed debugging
logging = "on"
- do not use loudnorm to normalize audio (not recommended as on long videos you will notice the volume increase as you go)
use_loudnorm = False
If you want to run with python 3.6 (on windows) you have to comment out line 23 making it look like this
# import edge_tts
Of course then you have to use only the native windows tts and not the online tts
There are some srt files (I found this problem on some automatic srt files from YouTube) that have two tracks at the same time, which causes an error in my program.
To fix this, you can use this script: fix_srt_timestamps.py
python3 fix_srt_timestamps.py -i input.srt -o output.srt