Friday, 1 June 2012

Let's your mac read for you

One of the most interesting that comes with Mac, and many people doesn't aware about it, is it can read any text for you.

One of the way to use this feature is using the terminal.
1. Open the terminal
2. Type

say hello world!
say "hello world!"

Apparently there is not difference between both commands. Actually, the second one is recommended, because with it, the command recognize the input as single text. One of the advantage of it is it can skip symbols as "(".

There are several interesting options

Save the voice as sound file
You can save the speak voice as sound file. The default format is aac. You can always changing it by specifying exactly the format you want

Here is a sample:

say -o hi.aac "hello world!"

Read from a txt file
The program can read the text from an txt file. For example, you might have an txt file called helloWorld.txt, which contains the follow string:

hello world

To read, you just has to type on the terminal:

say -f "helloWord"

Change the voice
This function is much more funnier if we switch the speaker. By default, it has several voices, from someone who has a REAL FROG in the throat to a PRINCESS.

To check the complete list, type:

say -v ?

Choose the speaker by typing her name. For example, for the princess, you should type

say -v Princess "hello world!"

For more information, here is the complete and official man page:

No comments:

Post a Comment