Hi,
I've tried adding this to the microsoft "speech_tech.sdk" newsgroup but as responses are pretty slow there I thought I'd try here. I wasn;t sure which section to add it into so went for the general area.
We are having a speed problem when setting the output of an ISpVoice to an output stream created in Global space.
The basic shell of the code is shown below. We create a Stream In Global space, Associate it with a COM stream and then set the output of our (already created voice) to this stream. When we use the ISpVoice::SetOutput method there is a delay of up to 6 seconds. We presume this is the IStream being dynamically allocated but can't see why it would take so long.
This happens on Windows Server 2003 SP1 but when run on Windows XP SP2 there is only a minimal delay (100ms).
I doesn't matter which TTS engine we are using.
Is there a reason why the Windows Server 2003 machine is taking so long and is there an solution to this problem.
Any help with this would be much appreciated.
Kevin
----- Code Example -----
CComPtr<ISpStream> m_spStream;
IStream* pStream;
// Create an SpStream
hr = m_spStream.CoCreateInstance( CLSID_SpStream );
// Create IStream in global memory, should dynamically allocate itself when
the time comes
if(SUCCEEDED(hr))
{
hr = CreateStreamOnHGlobal(NULL, TRUE, &pStream);
if (FAILED(hr)) { ... }
}
// Set the base stream
if(SUCCEEDED(hr))
{
hr = m_spStream->SetBaseStream(pStream, Fmt.FormatId(), Fmt.WaveFormatExPtr());
if (FAILED(hr)) { ... }
}
// Set output to stream
if(SUCCEEDED(hr))
{
hr = m_cpVoice->SetOutput(m_spStream, FALSE);
if (FAILED(hr)) { ... }
}
----- Code Example End -----