How to Record Text to Speech Using Terminal
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.
Launch the Terminal application from the Applications:Utilities folder.
Type cd ~/Desktop at the command prompt then press Enter.
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.
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).
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.
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.