Thanks to this answer, I was able to grant permission to the Terminal and iTerm2 apps to use a Personal Voice with the ‘say’ command; e.g.
say -v MyVoice "Hello, world!"
say command has a number of options, including
-o output.aiff which writes the spoken text to an AIFF file.
say -v Alex -o test.aiff "Hello world" afplay test.aiff
However, I can’t get it to work for my personal voice:
say -v MyVoice -o test.aiff "Hello world" afplay test.aiff
produces nothing but a moment of silence.
It seems most likely, judging from the number of loose ends I’ve hit playing with the Personal Voice feature, that this is a bug, but perhaps I’ve overlooked something.