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.
Share
Categories
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
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 Permalink rate up rate down Reply-1 error, speaking failed. It will say strings, but not files.
May 02 2005 at 6:01 PM Report abuse Permalink rate up rate down ReplyThe 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 Permalink rate up rate down ReplyI 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 Permalink rate up rate down Replysteve, http://www.macosxhints.com
April 27 2005 at 2:38 PM Report abuse Permalink rate up rate down Replyjustin, 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 Permalink rate up rate down ReplyCK - 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 Permalink rate up rate down Replyas 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 Permalink rate up rate down ReplyThat 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 Permalink rate up rate down Replywe 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 Permalink rate up rate down ReplyHot Apps on TUAW
Deals of the Day
more deals- Refurb MacBook Air Core i5 Dual 1.6GHz 12" Laptop for $750 + free shipping
- Sony Dock 20W Speaker System for iPhone / iPod for $51 + $15 s&h
- Soulo Karaoke App and Wireless Mic for iPhone / iPad for $80 + free shipping
- Verizon Leather Sleeve for Tablets for $4 + free shipping
- Wicked Jaw Breaker Noise-Isolating In-Ear Headphones for $6 + free shipping
- Refurb Apple MacBook Air Laptops: 12" 64GB SSD for $699 + free shipping
Software Updates
more updates- EFI Firmware Update brings Lion Internet Recovery to 2010-model Macs
- OS X Lion 10.7.3 released with Safari 5.1.3, Wi-Fi bug fix
- Aperture updated to 3.2.2, addresses Photo Stream issue
- Apple updates Keynote to address Lion issues
- Google Search app gets new look on iPad
- Apple releases Apple TV Software Update 4.4.3



11 Comments