Name

say

Synopsis

    say [options] string | -ffile

Text to speech synthesizer. The text is converted to sound and played through the system’s speakers, or saved to a file.

Options

-f file

Read the text in file.

-o file .aiff

Save the sound in the given output file.

-v voice

Use the given voice for producing speech. Both masculine and feminine voices are available. The default voice is selected in the System Preferences.

Example

Add voice prompts to your shell scripts with the following shell function:

    prompt () {
        say "$*" &                 Play prompt in background
        echo -n "$*"": "           Traditional shell prompting
    }

Get Unix in a Nutshell, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.