Talking Terminal: Have Your Mac Say Hello

Have your Mac speak up with these Terminal commands

Microphone with red background
A little Terminal trickery will have the Mac singing in no time.

 Darryn van der Walt / Getty Images

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.

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" will be 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, here's how:

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

  2. Select Accessibility.

  3. In the left window pane, scroll down and select Dictation > Open Dictation & Speech Preferences...

  4. Select the Text to Speech tab.

  5. From the System Voice drop-down menu, select Customize. A pop-up window will display all of the available voices your Mac can use.

You will notice some voice checkboxes 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, then select the Play button to hear the voice speak a sentence or two.

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

say -v ? 

Terminal will list 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 will be executed, so the easiest way to produce long speeches is to type them into a text editor first and then copy/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