Filed under: Audio, iPod Family, Tips and tricks
Terminal Tips: 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.
Get a WordPress.com Blog
![TUAW [Cafepress]](http://www.blogsmithmedia.com/www.tuaw.com/media/tuaw-cafepress-promo.png)


Reader Comments (Page 1 of 1)
Thomas Mango said 4:17PM on 6-16-2005
That is really, really cool. I can't wait to get home and try that. Maybe I will listen to the mobile ip rfc instead of reading it tonight : ) Thanks for the tip!
Reply
Brian said 4:17PM on 6-16-2005
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.
Reply
Childoferna said 3:01PM on 6-17-2005
That is a great tip, thanks CK. I'm off to www.gutenberg.org to make my own (free) audio books. Wow
Reply
justin said 4:17PM on 6-16-2005
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
Reply
Steve said 4:17PM on 6-16-2005
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 :)
Reply
Steve said 4:17PM on 6-16-2005
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!
Reply
turnerm5 said 7:16PM on 7-29-2005
steve,
http://www.macosxhints.com
Reply
KEN said 4:17PM on 6-16-2005
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?
Reply
AnotherSpeechGuy said 4:17PM on 6-16-2005
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.
Reply
Rob said 4:17PM on 6-16-2005
-1 error, speaking failed. It will say strings, but not files.
Reply
peter said 12:06AM on 1-04-2006
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?
Reply