f



SAPI 5.1 Problems on Windows 2003 Server

I posted this to some of the microsoft newsgroups with no response.
Thought I would give it a try here.  Anyway...

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
0
8/17/2005 9:54:07 PM
comp.speech.users 984 articles. 0 followers. mmarkoe954 (57) is leader. Post Follow

0 Replies
364 Views

Similar Articles

[PageSpeed] 17

Reply: