Skip to content

Instantly share code, notes, and snippets.

@sherief
Forked from 3735943886/simplesapi2.cpp
Created August 4, 2023 17:27
Show Gist options
  • Save sherief/d1f27f893469f292568992c86d621eeb to your computer and use it in GitHub Desktop.
Save sherief/d1f27f893469f292568992c86d621eeb to your computer and use it in GitHub Desktop.
#include <atlbase.h>
#include <sapi.h>
 
void main()
{
    CComPtr<ISpVoice> cpVoice;
 
    ::CoInitialize(nullptr);
 
    cpVoice.CoCreateInstance(CLSID_SpVoice);
    cpVoice->Speak(L"Hello World", SPF_DEFAULT, nullptr);
 
    ::CoUninitialize();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment