-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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