Rob’s Practical Joke of the Week: Fun with the Mac “say” command and ssh
Macs have a fun command-line program called “say”. You type “say” and enter some text and it reads it to you. Fun stuff. I like pasting news articles into it and having it read them to me.
For the those that don’t know, you can open a command-line terminal by going to Applications > Utilities > Terminal. Open Terminal and then you can start entering text commands. Try typing: say hello, you are a geek and hit return.
Now that’s all fun and dandy, but then I got the brilliant idea that I could ssh (login remotely) into another Mac and make it talk. Oh the fun that you could have with co-workers, friends and family! Here’s how you can do that :
- Log directly onto the Mac that you want to make talk
- Go to System Preferences>Sharing. In the Services section, make sure that “Remote Login” is checked.
- Highlight Remote Login and take note of the text below the checkboxes. It should say something like: To log in to this computer remotely, type “ssh username@123.123.123.12” at a shell command
- Write down the exact text that looks like “ssh username@123.123.123.12”
- Log out of the computer and leave it however you usually leave it when you are not using it and wait for the next lucky person to use the machine
[by the way I am not advocating hacking into people's machines, I assume that maybe you have a family computer that many people use
]
Now from another computer (on the same network) open up a command prompt and enter the text that you wrote down above, something like ssh username@123.123.123.12. You will be prompted for your password, enter it. You may be asked to accept a key or something like that, if so, type yes and hit return.
If your other computer is Windows, you can use something like putty to remote into the target Mac. Just download putty.exe , launch it, and then enter username@123.123.123.12 into the main textbox to login remotely (leave off the ssh).
Once you are remotely logged in, you can just enter the same “say” command but it will say it on the other computer! Here are some fun ideas for things to have the computer say to other people
- Make a sexy come-on from the computer to our lucky victim.
- Have the computer threaten to go on strike if he is not treated better.
- Speak from the perspective of a trapped little person in the computer.
- Have it sing “Mr. Roboto” Try: say domo ari got toe, mr. robot oh. domo. domo. Or to really have it “sing” try: say -v “Good News” domo ari got toe, mr. robot oh. domo. domo.
Sometimes the computer does not speak things perfectly, especially proper nouns. Try experimenting on your own machine before you attack your victim. Spell things out phonetically if it can’t say something correctly.
For fun you can change the voice with the -v flag. One example alternate voice is “Whisper”. So to act like there is someone trapped in the computer you could enter:
say -v Whisper Help, get me out of this computer. Garga Mel locked me in here again!
Here are a list of the available voices that come on a Mac. The names are case sensitive and enter the names in quotes if there is a space in the name:
Female Voices
- Agnes - relatively natural female voice
- Kathy - sounds like a computer, kind of like the computer voice in OK Computer
- Princess – kind of sounds like an old lady
- Vicki - most natural, kind of whispery
- Victoria – computery sounding
Male Voices
- Bruce – most natural male voice
- Fred – sounds like a computer
- Junior – sounds like a girl
- Ralph – deep voice
Novelty Voices
Albert – funny weak whispery high pitched voice
Bad News – very slow lo-pitched voice (put “Bad News” in quotes)
Bahh – choppy whispery weak voice
Bells – Melodic bells within voice, relatively slow paced
Boing – Mid-pitched typical computer voice with “boing” sound in each syllable
Bubbles – Whispery voice with bubble sounds in each syllable
Cellos – Melodic voice with cello voice, each syllable is a successive note in a simple tune
Deranged – Old man-ish voice, think Grandpa Simpson
Good News - Says words to the tune of “Pomp and Circumstance” or other tunes
Hysterical – Laughing/chuckling man voice (funny but hard to understand)
Pipe Organ – Low “pipe organ” melodic voice
Trinoids – Monotonous mid-pitched computer voice
Whisper – Whispery, kind of desperate sounding, sounds like it is having trouble breathing
Zarvox – Monotonous mid-pitched computer voice
Want to sample all of the voices? Paste the following into your Terminal and hit return:
say -v Agnes Hello, I am Agnes.
say -v Kathy Hello, I am Kathy.
say -v Princess Hello, I am Princess.
say -v Vicki Hello, I am Vicki.
say -v Victoria Hello, I am Victoria.
say -v Bruce Hello, I am Bruce.
say -v Fred Hello, I am Fred.
say -v Junior Hello, I am Junior.
say -v Ralph Hello, I am Ralph.
say -v Albert Hello, I am Albert.
say -v “Bad News” Hello, I am Bad News.
say -v Bahh Hello, I am Bahh.
say -v Bells Hello, I am Bells.
say -v Boing Hello, I am Boing.
say -v Bubbles Hello, I am Bubbles.
say -v Cellos Hello, I am Cellos.
say -v Deranged Hello, I am Deranged.
say -v “Good News” Hello, I am Good News.
say -v Hysterical Hello, I am Hysterical.
say -v “Pipe Organ” Hello, I am Pipe Organ.
say -v Trinoids Hello, I am Trinoids.
say -v Whisper Hello, I am Whisper.
say -v Zarvox Hello, I am Zarvox.
Happy practical joking!
You might want to turn off Remote Login when you are done playing, just to be safe!
Addendum July 2009 You might want to check out my more useful use of the Mac text-to-speech capabilities: Copywriting Tip: Have Your Computer Read Your Writing Back to You




















13 comments
this is absolutely brilliant
I’m glad you enjoy, Jonathan. Thanks for reading! You still rocking out w/ your guitar?
Yes I am. I plan on taking to to college with me.
Do you have any idea how to record the Say command to a MP3 file?
Tomer:
You can save a “say” command to an AIFF (Mac audio file) by passing the “-o FILENAME” before you write the text to say.
For example:
say -o hello.aif hello tomer
will save the file into the your home folder called hello.aif and it will just say “hello tomer”
If you want to convert it to MP3, open the file in iTunes, click and hold the file in iTunes and select “convert to MP3″.
Thanks!
ummm. how do u get to applications?
@olivia
If you have a Finder window open, the Applications folder appears in the left panel usually.
To open Finder, click on the hard drive icon on your desktop. Then look for the Applications folder, available both in the main list and on the left panel.
Finally, if all else, do it the geeky way, keyboard shortcut: hit Command+Shift+A
-Rob
launch app…
cd /
open /Applications/[insert app name here].app
example… open /Applications/iChat.app
then to quit it…
killall -m iChat
Oh what fun you can have opening and quitting apps on a target machine… heck, you can script it to make it seem possessed…
(type it up in textedit, then copy and paste into your ssh session… remember to add a carriage return or two after your last command)
say -v zarvox “all your ichat are belong to us”
open /Applications/iChat.app
say -v trinoids “we do not like this weak chat application”
say -v zarvox “we will kill it then”
killall -m iChat
use your imagination!!!
I’m not sure you want to encourage this kind of thing … I remember back in ‘81, I was programming with a bunch playing around with Berkeley Unix who discovered that it was possible to take control of another’s terminal and start typing so-called funny messages on it. For several weeks there were “I have control of your vertical” wars all over the group. The culmination was when one guy accidentally took control of a terminal that was doing a remote demo for a government agency. Luckily, our boss was a good sort, and persuaded the government that this was a Good Thing: clearly our skills at taking control of the application showed that we were better at preventing any one else from hacking in. Anyway, programming was a lot more restful when that died down …
what is the name of the tune the voice cellos is singing?
Cellos sing In the Hall of the Mountain King
Lawl. Thanks.
Leave a Comment