Skip to content

Instantly share code, notes, and snippets.

@hongymagic
Created March 12, 2012 03:11
Show Gist options
  • Save hongymagic/2019481 to your computer and use it in GitHub Desktop.
Save hongymagic/2019481 to your computer and use it in GitHub Desktop.
Generate wav files of Mac voices spelling out the alphabet
#!/bin/zsh
local IFS=$'\n'
for voice in `say -v '?' | cut -c1-20 | sed 's/ *$//g' | tr '[A-Z]' '[a-z]'`
do
for alphabet in `perl -le 'do { print $_ } foreach (a..z);'`
do
if [ ! -d ${voice} ]
then
mkdir ${voice}
fi
local file="${voice}/${alphabet}"
`say -v "${voice}" -o "${file}.aiff" ${alphabet}`
`lame --decode "${file}.aiff" "${file}.wav" && rm "${file}.aiff"`
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment