Skip to content

Instantly share code, notes, and snippets.

@xguse
Created November 29, 2011 21:48
Show Gist options
  • Save xguse/1406704 to your computer and use it in GitHub Desktop.
Save xguse/1406704 to your computer and use it in GitHub Desktop.
Female robot voice that speaks text. Can be used as a tack-on after a long running command to tell you that it has finished. Uses espeak and sox/play. Allows setting volume and repeat value.
#!/bin/sh
slp=0s
rep=0
vol=1
text='Type something Here for me to say.'
while getopts 'w:r:v:t:' OPTION
do
case $OPTION in
w) slp="$OPTARG"
;;
r) rep="$OPTARG"
;;
v) vol="$OPTARG"
;;
t) text="$OPTARG"
;;
?) printf "Usage: %s: [-w wait <$slp>] [-r repeat <$rep>] [-v vol <$vol>] [-t text <$text>] \n" $(basename $0)
exit 2
;;
esac
done
sleep $slp
echo $text | espeak --stdout -s120 -k18 -a200 -v 'en+f5' --stdin | play -v $vol -t wav - \
chorus 0.4 0.8 20 0.5 0.10 2 -t \
echo 0.9 0.8 33 0.9 \
echo 0.7 0.7 10 0.2 \
echo 0.9 0.2 55 0.5 \
gain 20 \
repeat $rep
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment