MacOS – Downloading additional voices from command-line

command linemacosspeechtext to speech

I am using a MacOS X server (to which I only have command-line access) to convert text to speech which is saved to sound files (using PyObjC). I would like to install some of the optional OS X voices (for example com.apple.speech.synthesis.voice.tom.premium) but I need to be able to do this through the command-line rather than via the System Preferences. Does anyone know a way to do this?

Best Answer

You can predownload the voice files to your App/Python package (or however you are distributing your app), and then write a script to move or copy the voice files to this folder:

/System/Library/Speech/Voices/

So:

  1. Download the voice files on your development machine
  2. Wrap them inside an assets folder or something like this
  3. Part of your Travis script can be to move the files first in the Voices folder on the mac
  4. And after that, you run your tests/other scripts
Related Question