views:

293

answers:

3

The mac command say can specify the voice used with the -v flag.

say -v Alex "compile completed, put your swords down."

The available voices can be seen in System Preferences/Speech/Text to Speech. How can I get this list programmatically?

+4  A: 

[NSSpeechSynthesizer availableVoices]

Chuck
nice! This wouldn't be callable via python by any chance?
Mark Harrison
I'm sure you could call it through PyObjC, which is included with Mac OS X 10.5 and above (and downloadable for earlier versions).
Chuck
you're right, I've copied the incanation below... thanks a bunch!!
Mark Harrison
+1  A: 

Shell Version, no hack too cheap!

(Don't actually use this, use the python version instead.)

ls /System/Library/Speech/Voices | sed 's/.SpeechVoice$//'

Agnes
Albert
Alex
BadNews
Bahh
Bells
Boing
...
Mark Harrison
+1  A: 

Python Version, courtesy of Barry Wark:

from AppKit import NSSpeechSynthesizer
print NSSpeechSynthesizer.availableVoices()
Mark Harrison