Created
January 30, 2019 19:47
-
-
Save allenmichael/e93d6b9443b871653a67482f8ba71ac0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
if [ -z "$1" ] | |
then | |
read -p "Please enter text: " TEXT | |
else | |
TEXT=$1 | |
fi | |
if [ -z "$2" ] | |
then | |
read -p "Pick a voice: " VOICE | |
if [ -z "$VOICE" ] | |
then | |
VOICE="Justin" | |
fi | |
else | |
VOICE=$2 | |
fi | |
# aws polly describe-voices will list all voices | |
# aws polly describe-voices --query 'Voices[?starts_with(LanguageCode, `en`)]' limits to only English speaking voices | |
aws polly synthesize-speech 'pol_bash.mp3' --text "$TEXT" --output-format 'mp3' --voice-id "$VOICE" | |
afplay pol_bash.mp3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment