O'Reilly logo

Mac OS X Tiger in a Nutshell by Jason McIntosh, Chuck Toporek, Chris Stone, Andy Lester

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

say

Synopsis

say [-v voice] [-o out.aiff] [-f file | string ... ]

Uses Mac OS X's Speech Synthesis manager to speak the file or string using the default voice set in the Speech preference panel (System Preferences Speech Text to Speech System Voice).

Options

string

Text to be spoken using the default system voice; for example:

$ say "I love Mac OS X"

Notice how the system pronounces the "X" of "Mac OS X" as "ten."

-f file

Specify a file to be read as input and spoken using the default system voice; for example:

$ say -f
                              filename
                              .txt
-v voice

Use the specified voice instead of the default system voice; for example

$ say -v Fred "I love Mac OS X"

This uses the Fred voice to speak the string, "I love Mac OS X." The list of voices can be found in the Speech Default Voices preference panel.

-o out .aiff

Output the spoken text as an AIFF sound file; for example,

$ say -o ~/Desktop/iheartmosx.aiff -v Fred "I love Mac OS X"

This command uses the voice Fred to speak the string "I love Mac OS X," and save it as a sound file named iheartmosx.aiff on the Desktop. When outputting a sound file, the -o option must immediately follow the say command.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required