How to Record Text to Speech Using Terminal

How to Record Text to Speech Using Terminal

Posted by · 111862 views · Translate
Hebrew
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.
How to Record Text to Speech Using Terminal

Step Two
Type cd ~/Desktop at the command prompt then press Enter.
How to Record Text to Speech Using Terminal

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.
How to Record Text to Speech Using Terminal

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).
How to Record Text to Speech Using Terminal

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.
How to Record Text to Speech Using Terminal

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.
How to Record Text to Speech Using Terminal

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.
Benjamin Richards - December 13, 2016 at 2:26pm
What is the purpose of step two as intended by iClarified? I know cd is Change Directory, I know ~ is the current user's home folder, I have read the man page for the say command, I have looked at multiple procedural videos or articles related to the say command, yet iClarified is the only source that includes the switch to Desktop folder command. Hence what is it's purpose? As I can see none other than reducing the number of characters that need be typed in the -f or -o flags, but since I prefer absolute paths, it becomes a mute point and seems like an unnecessary step… If iClarified truly wants to adhere to the notion of clarity as is implied by the name, a better description is needed as to why you are including that step.
andrewsanchez - January 18, 2017 at 8:29pm
It's very likely because ~/Desktop is a convenient point of reference for people who do not have a background in the Unix shell. They can see their output immediately on the Desktop without having to learn any more commands, e.g. the `ls` command. It's just a matter of convenience for lowering the learning curve. Other than that, there is no reason for cd'ing to the Desktop.
bran - September 21, 2014 at 9:41am
awesome.
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...
5 More Comments
Recent