Making The Mac Talk Via Terminal

Joined
Dec 8, 2006
Messages
59
Reaction score
2
Points
8
Your Mac's Specs
MacBook Pro, OSX 10.4.8, 2.33 GHz Intel Core 2 Duo 2 GB 667 MHz DDR2 SDRAM
Hi everyone, is there a way to make the Mac talk via the terminal window? (command prompt).

I know how to make it talk from the System Preference but can I do it via the prompt? :headphone
 
Joined
Feb 13, 2005
Messages
1,186
Reaction score
73
Points
48
Location
New Orleans, LA, USA
Your Mac's Specs
13" Macbook Pro 2.26Ghz Unibody 4G RAM 160G HDD Superdrive
$ say what you want it to say

It'll do it in whatever voice is selected.
 
Joined
Feb 13, 2005
Messages
1,186
Reaction score
73
Points
48
Location
New Orleans, LA, USA
Your Mac's Specs
13" Macbook Pro 2.26Ghz Unibody 4G RAM 160G HDD Superdrive
G'day arai speed,

I'm interested to know what this would be useful for?

Well, I use a lot of command line utilties, some of which take awhile to complete. Okay, maybe not so much now with faster macs, but I could write a script that encodes a bunch of .aiff files to .mp3. At the end of the script I could put in

/usr/bin/say your files have been encoded, by your command

Then I would know it was done, and it would be like a cylon told me!
 
Joined
Apr 29, 2006
Messages
4,576
Reaction score
378
Points
83
Location
St. Somewhere
Your Mac's Specs
Mac Studio, M1 Max, 32 GB RAM, 2 TB SSD
That is too cool! I come from a Linux background and I thought I knew my way around the command line but this is a great new command I had no idea even existed! Too cool. Thanks!
 
OP
A
Joined
Dec 8, 2006
Messages
59
Reaction score
2
Points
8
Your Mac's Specs
MacBook Pro, OSX 10.4.8, 2.33 GHz Intel Core 2 Duo 2 GB 667 MHz DDR2 SDRAM
G'day arai speed,

I'm interested to know what this would be useful for?

I want to use it to play a prank on a co-worker :)
 
Joined
Jun 25, 2005
Messages
3,231
Reaction score
112
Points
63
Location
On the road
Your Mac's Specs
2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid
I have the following line in my crontab to remind me it is getting late on a work nite. It sets the volume so it isn't too loud and selects a prefered voice.

osascript -e "set Volume 4" -e 'say "Its 11 PM." using "Victoria"'​

To select the voice on the command line do this;

say -v "Agnes" "Its 11 PM."​

The voices in Leopard are suppose to be way better than 10.4.
 
Joined
Oct 27, 2005
Messages
4,702
Reaction score
404
Points
83
Hey I just did that xstep ... I'll probably forget it next time I try to impress someone with a terminal trick ....
 
Joined
Apr 29, 2006
Messages
4,576
Reaction score
378
Points
83
Location
St. Somewhere
Your Mac's Specs
Mac Studio, M1 Max, 32 GB RAM, 2 TB SSD
I just tried this and it turns out that the quotes aren't needed. For example, I can just type:

say -v Agnes Hi There Sailor

and it works.

Is there some place to get a listing of the available voices? From the above we see Agnes and Victoria - how many more are available?
 
Joined
Apr 25, 2003
Messages
1,301
Reaction score
62
Points
48
Location
The home of the free and the land that did for Bra
Your Mac's Specs
24"iMac, 15"MB-Pro, MacBook, G4 iMac, PM G5 2x2Ghz, G4 iBook & Some PCs
Is there some place to get a listing of the available voices? From the above we see Agnes and Victoria - how many more are available?

System Preferences->Speech->Text to Speech and the list is in a drop down menu.

Amen-Moses
 
Joined
Apr 29, 2006
Messages
4,576
Reaction score
378
Points
83
Location
St. Somewhere
Your Mac's Specs
Mac Studio, M1 Max, 32 GB RAM, 2 TB SSD
Thanks Amen-Moses. Much appreciated!
 
Joined
May 27, 2006
Messages
445
Reaction score
16
Points
18
Location
Concord, NC
Your Mac's Specs
Macbook Pro 17" 2.6GHz 4GB RAM
Joined
Jan 19, 2007
Messages
130
Reaction score
9
Points
18
Location
Pennsylvania
Your Mac's Specs
MacBook Pro-2.16Ghz Intel Core 2 Duo-3GB RAM-120GB HDD
I noticed when you don't use the quotes that it says the statement then repeat the entire thing with "say -v Agnes Its 11pm"
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top