This script generates an audio file (.wav) from a .srt file with timings. There can be unwanted shifts in the final audio if a time interval of a text is not adequate for dubbing.
- pydub: Used for audio segment manipulations.
- pysub-parser: Used for parsing .srt files.
- pyttsx3: An offline text-to-speech library used for dubbing.
Clone the repository and than install the requirements with the following command.
pip install -r requirements.txt
Here is an example usage. with command line options.
python subtitle_to_audio.py -p test/test.srt -r 120 -v 1