Skip to content

Instantly share code, notes, and snippets.

@lcapaldo
Created October 24, 2011 05:23
Show Gist options
  • Select an option

  • Save lcapaldo/1308425 to your computer and use it in GitHub Desktop.

Select an option

Save lcapaldo/1308425 to your computer and use it in GitHub Desktop.
Say tool (text to speech on the command line using SAPI)
#include <windows.h>
#include <sapi.h>
int wmain(int argc, wchar_t** argv)
{
ISpVoice *pVoice;
CoInitialize(0);
CoCreateInstance(CLSID_SpVoice, NULL, CLSCTX_ALL, IID_PPV_ARGS( &pVoice ) );
pVoice->Speak(argv[1], 0, NULL);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment