Skip to content

jmarhee/polly-textfile-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AWS Polly Textfile CLI

This package takes a filepath, breaks it into < 250 character sentences for text-to-speech processing by AWS Polly, and then locally, merges the chunks back into a single mp3 file.

Requirements

This requires an AWS account. You will need to set the following environmental variables:

AWS_DEFAULT_REGION=us-east-2
AWS_SECRET_ACCESS_KEY=${YOUR_SECRET_KEY}
AWS_ACCESS_KEY_ID=${YOUR_ACCESS_KEY}

or if you have awscli installed, run aws configure to provide these details to generate a config file.

You will also need ffmpeg installed on your machine.

Installation

Install from PyPi:

pip3 install polly-textfile-cli

or from this repo:

pip3 install git+https://github.com/jmarhee/polly-textreader-cli.git

or clone and install, if developing with this package:

git clone https://github/jmarhee/polly-textreader-cli.git
cd polly-textreader-cli
pip3 install -e .

then test that the polly-textfile package is available in your PATH:

which polly-textfile

and proceed.

Usage

Run the following command:

polly-textfile --path your-text-file.txt --name output-name-no-extension

Upon completion, you'll have the component files (your-output-name-part-$i.mp3) and the concatenated audio file (your-output-name.mp3).