How to Record Text to Speech Using Terminal

Posted February 11, 2009 at 10:02pm by iClarified | Please help us and submit a translation by clicking here | 77974 views

These are instructions on how to create audio files using the Mac OS X Text to Speech feature. Using Terminal you can have your Mac read text aloud or directly into an audio file for playback later.

Step One
Launch the Terminal application from the Applications:Utilities folder.

Step Two
Type cd ~/Desktop at the command prompt then press Enter.

Step Three
To have your Mac read a string aloud type say "read this" then press Enter. You can replace the text in quotes with your own.

Step Four
To have your Mac read in a different voice type say -v Kathy "read this" then press Enter. You can replace Kathy with any of the Mac voices (ie Alex, Bruce, Fred, Kathy, Vicki, Victoria).

Step Five
To have your Mac read from a text file type say -v Alex -f "textfile.rtf" and press Enter. Replace textfile.rtf with the filename of a plain text file you have placed on your desktop. You can use the full file path to read a text file from a different location.

Step Six
Finally to have your Mac read straight into an audio file type say -v Alex -o "audiofile.aiff" "read this" and press Enter. Replace "audiofile.aiff" with the audio filename you would like created.

NOTE***: If you want to combine all the options together you could do something like this... say -v Alex -o "audiofile.aiff" -f "textfile.rtf" to read a textfile in Alex's voice direct to an audiofile.

Add Comment
Gazolla - January 16, 2010 at 6:45pm
Excellent !!!! Thank you very much.
Joe Maurer - December 28, 2009 at 11:49pm
This is great! Easy to use and totally works for making files. You can keep system prefs open and toggle between it and terminal to bypass steps 3-5. Speakable items in system prefs allows you adjust voice (and rate of speech). If you\'d like to make mp3\'s of the aiff files pull them into itunes and convert them to mp3s...
Mikey Bee - June 15, 2009 at 12:06am
I wrote a program to read text files and output large font window with the text. It goes by stanza by stanza. It\'s free, and the source code is available to on google code:
w.madsen - April 10, 2009 at 3:30pm
Are you aware of any other commands available to the speech program, such as controlling the timbre or speed of the output?
Mikey Bee - July 10, 2009 at 2:56am
The speech command seems to be very limited. Open a terminal and type: man say The Speech API\'s offer more control:
Ashraf - October 21, 2012 at 11:41pm
-r rate, --rate=rate Speech rate to be used, in words per minute. So you could write: say -r 80 -v Victoria "read this" That'd make victoria read "read this" at 80 words per minute (slow)
OSXniCKels - March 27, 2009 at 12:55am
What other audio formats can be used when saving to a file?
0 More Comments
Follow iClarified
Apple Seeds iCloud for Windows Beta with iCloud Drive Support to AppleSeed Members
Office for iPad Now Supports Monthly Subscriptions
Microsoft has announced that Office for iPad ...
Amazon Cloud Drive Photos App Now Lets You View Metadata, Rename Albums, Stream via AirPlay
Plants vs. Zombies 2 Brings Back the Vasebreaker Mini-Game
Plants vs. Zombies 2 has been updated to brin...
Apple Says Leak of Nude Celebrity Photos Was Not Due to iCloud Breach
Apple has announced the results of its invest...