Search code examples
macostext-to-speech

Getting list of Mac text-to-speech voices programmatically?


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?


Solution

  • [NSSpeechSynthesizer availableVoices]