Skip to content

Instantly share code, notes, and snippets.

@makyo
Last active September 23, 2020 04:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save makyo/16640c0b5ef4989996a08ffbe585fc7c to your computer and use it in GitHub Desktop.
Save makyo/16640c0b5ef4989996a08ffbe585fc7c to your computer and use it in GitHub Desktop.
#!/bin/bash
infile="$1"
while read line; do
words=`echo "$line" | wc -w`
if [ $words -gt 0 ]; then
bytes=`espeak "$line" --stdout | wc --bytes`
seconds=`python -c "print(float($bytes) / 44000.0)"`
echo "$line"
sleep $seconds
fi
done < $infile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment