Talking Terminal: Have Your Mac Say Hello

Have your Mac speak up with these Terminal commands

Our list of Terminal tricks is a mix of business and pleasure. Some serve as functional improvements to the experience of using a Mac, and others are just for fun, such as the "say" command.

"Say" is a Terminal command that directs the Mac to speak anything you type after it. Try it out by launching Terminal (Finder > Applications > Utilities), and then typing the following into the command line:

say hello

This command will direct your Mac to speak the word "hello" or whatever else you type after the initial "say" command.

Microphone with red background
Darryn van der Walt / Getty Images

You can also specify which voice your Mac should use when it speaks using the -v attribute. For example:

say -v fred hello

In this case, the voice named "Fred" is used to speak the entered command.

Mac's Many Voices

The Mac has a lot of voices it can use for speech commands. Currently, there are over 100 voices available in various languages and styles. If you would like to scan and try out the full list of the voices, you can, either in Terminal or in the Mac System Preferences.

Accessing Voices in System Preferences

  1. Launch System Preferences by selecting the Dock icon or the System Preferences option from the Apple menu.

  2. Select Accessibility in the System Preferences screen.

    Mac System Preferences with Accessibility icon highlighted
  3. In the left pane, select Speech. (In early versions of the operating system, select Dictation > Open Dictation & Speech Preferences and choose the Text to Speech tab instead.)

    Accessibility preferences with Speech highlighted
  4. From the System Voice drop-down menu, select Customize.

    System Voice drop-down menu with Customize highlighted

    A pop-up window displays all the available voices your Mac can use.

    You will notice some voice check boxes are marked and others are not. The checked voices are displayed in the System Voice drop-down menu. Use this menu to select a voice you'd like to try out and then select the Play button to hear the voice speak a sentence or two.

Accessing Voices in Terminal

An alternate method to view all the available voices is to enter the following command in Terminal:

say -v ?

Terminal lists all of the available voices.

When specifying a voice in Terminal, use all lowercase letters. If the name has a space in it, such as Bad News, place it in quotes, like this:

say -v 'bad news' hello

Time for Terminal to Sing

The Say command can speak for as long as a single line will allow. If you hit the return key, the command is executed, so the easiest way to produce long speeches is to type them into a text editor first and then copy and paste them into Terminal. The Say command understands some punctuation, including the period and the comma, both of which inject a slight pause into speaking the text.

With the right combination of words, you can even get the Say command to sing.

say -v 'pipe organ' Dum dum dee dum dum dum dum dee Dum dum dee dum dum dum dum dee dum dee dum dum dum de dum dum dum dee dum dee dum dum dee dummmmmmmmmmmmmmmmm

There are a few different voices that can be used for singing, all of them in the Novelty section of the Dictation & Speech preference pane. The ability of these voices to sing comes not from the text command but the character of the voice. Here are some more examples:

In the Hall of the Mountain King

The Cellos voice intonation is to the melody of In the Hall of the Mountain King. This will work with any string of text. Enter the following into Terminal to hear it:

say -v cellos Doo da doo da dum dee dee doodly doo dum dum dum doo da doo da doo da doo da doo dad doo da doo

Pomp and Circumstance

Try the following Terminal command for a bit of pomp on graduation day:

say -v 'good news' di di di di di di di di di di di di di di di di di di di di di di di di di di di di