Skip to content

Instantly share code, notes, and snippets.

@skratchdot
Created October 11, 2019 14:48
Show Gist options
  • Save skratchdot/c51634a97653928d21078986ffbb5cf4 to your computer and use it in GitHub Desktop.
Save skratchdot/c51634a97653928d21078986ffbb5cf4 to your computer and use it in GitHub Desktop.
some helper functions for the OSX say command (random words, random voices, etc)
## say with a random voice
say_rand () {
say -v $(say -v ? | awk '{print $1}' | shuf -n1) "$@"
}
## say with a random english voice
say_rand_en () {
say -v $(say -v ? | grep en_ | awk '{print $1}' | shuf -n1) "$@"
}
## random english word
say_word () {
shuf -n1 /usr/share/dict/words | say
}
## random english word with random english voice
say_word2 () {
shuf -n1 /usr/share/dict/words | say -v $(say -v ? | grep en_ | awk '{print $1}' | shuf -n1)
}
## random weird noise
say_noise () {
LC_CTYPE=C tr -dc 'a-z ' < /dev/urandom | head -c5 | say -v $(say -v ? | awk '{print $1}' | shuf -n1)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment