Skip to content

Instantly share code, notes, and snippets.

@tensorpudding
Created April 8, 2011 20:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tensorpudding/910609 to your computer and use it in GitHub Desktop.
Save tensorpudding/910609 to your computer and use it in GitHub Desktop.
say command, using festival and sh, that i came up with in five minutes
#!/bin/sh
# A very simplified version of OSX's say, using festival
# Usage: say [words]
usage="Usage: `basename $0` [-n | -f FILE | [WORDS]]"
if [ $# = 0 ]
then
echo $usage
exit 1
fi
if [ ! -x $(which festival) ]
then
echo 'Could not find festival! Are you sure it is installed?'
exit 1
fi
case "$1" in
-f)
if [ -n "$2" ]
then
festival -b --tts "$2"
exit 0
else
echo $usage
exit 1
fi
;;
-n)
festival --tts --pipe
exit 0
;;
*)
echo "$@" | festival --tts --pipe
exit 0
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment