The mac command say can specify the voice used with the -v flag.
say
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?
[NSSpeechSynthesizer availableVoices]