Perl one-liner to sample your Mac's voices


I've been following stories about Roger Ebert's new voice, which a company has made so that they can apparently plug it into his Mac. In his appearances on camera, the voice he's been using is the Mac "Alex" voice. What other voices does your Mac have? Here's a Perl one-liner to play them.

From the Terminal window, paste this in at the prompt:

perl -le'for (@ARGV){m{/(\w+?)\.SpeechVoice};' \
  -e'$_=$1;s/([a-z])([A-Z])/$1 $2/g;' \
  -e'print qq{say -v "$_" This is $_};}' \
  /System/Library/Speech/Voices/* | sh -x

On my Mac, "Organ" isn't found, but I don't know why.


Don't have a Mac in front of me, but I suspect you have a quoting issue there... The voice should be "Pipe Organ".

It must be too small to find.

Yuk yuk! Thank you, I'll be here all week.


Turns out that the directory and voice names don't match in that specific instance. "Organ.SpeechVoice" is the directory name, but "Pipe Organ" is the name of the voice.

Leave a comment

Job hunting for programmers

Land the Tech Job You Love, Andy Lester's guide to job hunting for programmers and other technical professionals, is available in PDF, ePub and .mobi formats, all DRM-free, as well as good old-fashioned paper.