Hello, i'm trying to make a simple speech recognition program using SAPI 5.1. However, it fails to initialize recognition context. When i'm trying to launch SAPI C++ samples, like dictation pad, they fail to initialize too. Guess it's because of recognition context.
It could be because my windows has russian interface, but recognizer engine starts successfully. The code is below:
int _tmain(int argc, _TCHAR* argv[])
{
if (FAILED(::CoInitialize(NULL)))
return FALSE;
HRESULT hr = S_OK;
CComPtr<ISpRecognizer> Engine;
hr = Engine.CoCreateInstance(CLSID_SpSharedRecognizer);
if ( FAILED( hr ) ){ // Покидаем приложение
MessageBoxA(0, "Unable to initialize recognition engine","Error",0);
return FALSE;
}
CComPtr<ISpRecoContext> Context;
hr = Engine->CreateRecoContext(&Context);
if ( FAILED( hr ) ){ //Покидаем приложение
MessageBoxA(0,"Unable to initialize recognition context", "Error", 0);
return FALSE;
}
::CoUninitialize();
pVoice->Release();
Engine->Release
pVoice = NULL;
return TRUE;
}
What's the problem?
Thanks in advance