Advertisement
Guest User

Microsoft Speech Api

a guest
Mar 18th, 2013
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.47 KB | None | 0 0
  1. #define COBJMACROS
  2. #include <sapi.h>
  3. #include <ole2.h>
  4. #include <stdio.h>
  5. int main(int argc, char* argv[])
  6. {
  7.     ISpVoice * pVoice = NULL;
  8.     HRESULT hr;
  9.     if (FAILED(CoInitialize(NULL))) return FALSE;
  10.     hr = CoCreateInstance(&CLSID_SpVoice, NULL, CLSCTX_ALL, &IID_ISpVoice, (void **)&pVoice);
  11.     if( SUCCEEDED( hr ) )
  12.     {hr = ISpVoice_Speak(pVoice, L"Hello world", 0, NULL); ISpVoice_Release(pVoice); pVoice = NULL;}
  13.     CoUninitialize();
  14.     return TRUE;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement