I’ve known for a while that Microsoft Windows comes with text-to-speech and speech-to-text APIs, which power the Narrator and Speech Recognition features respectively.
This forum post prompted me to mess around with them a little.
I came up with this implementation of a say.exe command which takes a single argument as text, and then uses the ISpVoice text-to-speech API to have the computer speak it aloud.
Source and binaries attached.
CoInitialize(nullptr); CoCreateInstance(ISpVoice) pSpVoice->Speak(text);
>say.exe "Daisy, Daisy; give me your answer, do."
More information on the Speech APIs available here: http://msdn.microsoft.com/en-us/library/ms723627(v=vs.85).aspx