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
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