First of all, C++ is not my language (I'm a java programmer).
I've seen examples of Microsoft SAPI 5.1, and I need a way to print all the available voices in a machine. I've seen the Object token of SAPI, and I'm kinda confuse of how CComPtr is use to iterate through. Can anyone help me with this. Additionally, how can I pick a specific voice instead of using the default.
Based from the examples, you can get the default voice by invoking this codes:
ISpVoice * pVoice = NULL;
if (FAILED(::CoInitialize(NULL)))
return FALSE;
HRESULT hr = CoCreateInstance(CLSID_SpVoice, NULL, CLSCTX_ALL, IID_ISpVoice, (void **)&pVoice);
So in short: How can I list all the voices available and how can I choose the voice?
//PS: I don't need to put it in a combo box (just like all examples that I've seen), I'm implementing this for a JNI dll library so an example of iteration is much preferred.