Skip to content

Instantly share code, notes, and snippets.

@iitenkida7
Created February 4, 2022 13:01
Show Gist options
  • Save iitenkida7/c44990714a081b0f7fb63ac39f305d43 to your computer and use it in GitHub Desktop.
Save iitenkida7/c44990714a081b0f7fb63ac39f305d43 to your computer and use it in GitHub Desktop.
get aws polly audio
#!/bin/bash
SCRIPT_DIR=$(cd $(dirname $0); pwd)
DATA_JSON=${SCRIPT_DIR}/../nuxt/typing_data.json
DIST_DIR=${SCRIPT_DIR}/../nuxt/public/audio
export AWS_PAGER=""
mkdir -p ${DIST_DIR}
for WORD in $(cat ${DATA_JSON} | jq -r ".[].word") ; do
echo ${WORD}
aws polly synthesize-speech \
--output-format mp3 \
--voice-id Matthew \
--text "${WORD}" \
${DIST_DIR}/${WORD}.mp3
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment