Getting Mac Text Messaging to Speech?

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

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

Available voices can be seen in the "System Preferences / Speech / Text for Speech" section. How can I get this list programmatically?

+23
macos text-to-speech
Sep 28 '09 at 23:06
source share
6 answers
+5
Sep 28 '09 at 23:20
source share

This is the list of available votes:

 say -v '?' 
+75
Feb 21 '13 at
source share
 for voice in `say -v '?' | awk '{print $1}'`; do say -v "$voice" "Hello, my name is $voice."; done 
+17
May 7 '15 at 14:17
source share

The shell version , without hacking is too cheap!

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

 ls /System/Library/Speech/Voices | sed 's/.SpeechVoice$//' Agnes Albert Alex BadNews Bahh Bells Boing ... 
+7
Sep 29 '09 at 0:26
source share

Python version , courtesy of Barry Wark :

 from AppKit import NSSpeechSynthesizer print NSSpeechSynthesizer.availableVoices() 
+7
Sep 29 '09 at 4:47
source share

It takes a few votes to pass before making a decision. There is a huge change in quality.

For example, Tom sounds a little impatient, but more realistic than Alex. And some British voices are great.

Using say -v '?' gives you a list of established voices plus some sample sentences that give you an idea of ​​what to expect from a vote. You need to go through the settings in order to set most of the really good voices, but they come with a compact voice that lets you hear each voice sound before you download them.

+2
Nov 27 '14 at 22:52
source share



All Articles