Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. #include <sapi.h>
  2.  
  3. int main(int argc, char* argv[])
  4. {
  5. ISpVoice * pVoice = NULL;
  6.  
  7. if (FAILED(::CoInitialize(NULL)))
  8. return FALSE;
  9.  
  10. HRESULT hr = CoCreateInstance(CLSID_SpVoice, NULL, CLSCTX_ALL, IID_ISpVoice, (void **)&pVoice);
  11. if( SUCCEEDED( hr ) )
  12. {
  13. hr = pVoice->Speak(L"Hello world", 0, NULL);
  14. pVoice->Release();
  15. pVoice = NULL;
  16. }
  17.  
  18. ::CoUninitialize();
  19. return TRUE;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement