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?
This is the list of available voices:
say -v '?'