/polly_srt2audio

Create audio voiceover from srt subtitle files using AWS Polly

Primary LanguagePythonApache License 2.0Apache-2.0

About

This is a script to convert a given *.srt subtitle file to a syncronized voiceover mp3 file. This is done by using AWS Polly for speech generation and then syncronizing according to the subtitle file.

Prerequisite

  • Python
  • An AWS account. It may incurr standard AWS Polly charges
  • AWS command line credentials already configured. Easiest way is to install AWS CLI and run aws configure

Installation

pip install -r requirements.txt

Usage

polly_srt2audio.py [-h] [--input_file INPUT_FILE] [--output_dir OUTPUT_DIR]
                          [--output_file OUTPUT_FILE] [--voice_id VOICE_ID]

Example

mkdir output
python polly_srt2audio.py --input_file /Users/XXX/Downloads/captions.srt --output_dir output

An example voiced-over video can be found here.