Skip to Content

Terminal Tips: Say

terminal say
Have you ever wanted to have your Mac convert a document / news story into an audio file so that you can listen to it on your iPod, but didn't want to spend the money on a high cost program to do it?  Well, it just so happens that OS X has a very powerful text to speech engine that is easily accessible via the command line.  Simply launch the Terminal (located in /Applications/Utilities/) and type say -f pathtotextfile -o ~/Desktop/convertedfile.aiff, substituting the path to the text file you want to convert for pathtotextfile and the name you want for the resulting audio file for convertedfile, and hit return.

Your Mac will read the file into an AIFF audio file on your Desktop using the Default Voice and reading-speed settings you have set up in your Speech control panel in the System Preferences. It may take a while to write the file, as it reads in real time.  Once it is done you will be returned to the shell prompt.

Now just drag the file into iTunes and convert to MP3 / AAC file and delete the original file to save some space.  Easy!

If you'd rather just have your Mac read a file out loud to you, then leave off the part from the -o command forward.
 

Have you ever wanted to have your Mac convert a document / news story into an audio file so that you can listen to it on your iPod,...
 

Add a Comment

*0 / 3000 Character Maximum

11 Comments

Filter by:
peter

there is a way to do this without using a text file. there is a way to get terminal to spit out the .aiff file using your own text in quotes. the instructions to do this are available in the "Mac os x web development" book by friends of ed. however I left that book at home. does anyone out there know what I am talking about and remember the terminal commands to make this happen?

January 04 2006 at 12:06 AM Report abuse rate up rate down Reply
Rob

-1 error, speaking failed. It will say strings, but not files.

May 02 2005 at 6:01 PM Report abuse rate up rate down Reply
AnotherSpeechGuy

The quality of the TTS voices is significantly improved in Tiger. They were already pretty good in Panther, but Apple put more work into them since then. I've heard some demos: the Vicki voice in particular, but all the other voises too, are smoother, more natural, more intelligible. Still sounds like a computer, but good progress.

April 28 2005 at 12:18 PM Report abuse rate up rate down Reply
KEN

I can't seem to get it to work out for me. The Terminal keeps telling me "Speaking failed: -1". What am I doing wrong?

April 27 2005 at 9:16 PM Report abuse rate up rate down Reply
turnerm5

steve, http://www.macosxhints.com

April 27 2005 at 2:38 PM Report abuse rate up rate down Reply
Steve

justin, I haven't seen an official place of tips, but getting a good RSS aggregator like NewsMac to keep on top of about 4-5 great sites (like Tuaw) and using Stickies (a post-it note like app that comes with OS X), I'm able to keep tips like this organized for easy reference. And with the spotlight search capabilities coming in 10.4 this Friday, it will be even EASIER to find these useful hints on your system after you've noted them in Stickies, in a PDF file, or elsewhere. Good luck - I just switch after 16 years on the PC platform and love it!

April 27 2005 at 1:52 PM Report abuse rate up rate down Reply
Steve

CK - you continue to prove your worth on the TUAW team - great gem - thanks for digging it up! Now off to convert a TON of stuff I need to read :)

April 27 2005 at 1:47 PM Report abuse rate up rate down Reply
justin

as a possible swithcer, is that sort of info readily available or would a mac user have to keep track of those types of tricks

April 27 2005 at 1:36 PM Report abuse rate up rate down Reply
Childoferna

That is a great tip, thanks CK. I'm off to www.gutenberg.org to make my own (free) audio books. Wow

April 27 2005 at 1:35 PM Report abuse rate up rate down Reply
Brian

we would use the say command while up at school to fool people into thinking that Macs can have conversations with people. My buddy would log into my Powerbook with Remote Login, then control my Terminal. Our friends would talk to the computer (which we named Bruce, thanks to the voice name) and he would reply from the other room. I can't tell you how many people wanted to get Macs after that. We would tell them that you could set it so you are talking to a sympathetic person, or a sarcastic person, whatever you want. It was great fun.

April 27 2005 at 1:18 PM Report abuse rate up rate down Reply
Buy an ad here

Hot Apps on TUAW

Tweets

© 2012 AOL Inc. All Rights Reserved.