SAPI 5.1 Problems on Windows 2003 Server

H

Howard Knight

I have an MFC program that uses the Microsoft Speech SDK (SAPI 5.1).
It runs great. But, after converting the program into a Win32
Service executable, I now have problems initializing SAPI on Windows
2003 Server. The service runs fine under Windows 2000 Server, and
Windows XP Pro.

The CoCreateInstance call is successful, but the call to
GetOutputStream fails with a returned hresult of 0x8004503a
(-2147200966). This is defined in sperror.h:

/*** SPERR_NOT_FOUND 0x8004503a -2147200966
* The requested data item (data key, value, etc.) was not found.
*/
#define SPERR_NOT_FOUND MAKE_SAPI_ERROR(0x03a)


Here's my sample code:

CComPtr<ISpVoice> m_cpVoice;
CComPtr<ISpStreamFormat> m_cpStream;

CSpStreamFormat Fmt;
USES_CONVERSION;
hr = m_cpVoice.CoCreateInstance(CLSID_SpVoice);
if (FAILED(hr))
logfile << "Could not instantiate Speech Encoder" << endl;
hr = m_cpVoice->GetOutputStream(&m_cpStream);
if (SUCCEEDED(hr))
hr = Fmt.AssignFormat(m_cpStream);
else
logfile << "Error getting voice output stream" << endl;

Any help would be greatly appreciated.

Howard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top