Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
import json, os
import pprint
# Generated voices.json with `aws polly describe-voices > voices.json`
with open('voices.json') as json_data:
d = json.load(json_data)
with open("a.txt") as f:
content = f.readlines()
# you may also want to remove whitespace characters like `\n` at the end of each line
content = [x.strip() for x in content]
for e in d["Voices"]:
if not os.path.exists(e["Name"]):
for x in content:
print("aws polly synthesize-speech \
--output-format mp3 \
--voice-id "+e["Name"]+" \
--text \""+x+"\"\
os.system("aws polly synthesize-speech \
--output-format mp3 \
--voice-id "+e["Name"]+" \
--text \""+x+"\"\
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.