Skip to content

Instantly share code, notes, and snippets.

@watr
Created February 23, 2012 14:21
Show Gist options
  • Save watr/1893045 to your computer and use it in GitHub Desktop.
Save watr/1893045 to your computer and use it in GitHub Desktop.
Mac sing a song "In the Hall of the Mountain King" using word you gave.
#!/bin/sh
################################
# set base word
################################
DEFAULT_WORD="foo"
word=$DEFAULT_WORD
# if argument exists, update word with argument[1]
if [ $# -gt 0 ]; then
word=$1
fi
################################
# start generationg song sentence
################################
sentence=""
# magic number of word count to sing a nice song
REPEAT=26
for i in `seq 1 $REPEAT`
do
sentence="${sentence} ${word}"
done
# print sencence for debug
#echo $sentence
################################
# run say command
################################
# save
#say -v Cellos -o ${word}.aiff $sentence
#echo audio file saved.
# sing
say -v Cellos $sentence
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment