Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Microsoft Speech SDK 4.0

58 views
Skip to first unread message

Alex Bakaev [TeamB]

unread,
Dec 7, 1999, 3:00:00 AM12/7/99
to
I had problems with the ActiveX controls in the SDK. I ended up just
using the API. Here is the sample of what I do:
#include <speech.h>
#if 1
#define TIAudioDest IAudioDest
#define TIID_IAudio IID_IAudioDest
#define TCLSID_IAudio CLSID_MMAudioDest
#else
#define TIAudioDest IAudioFile
#define TIID_IAudio IID_IAudioFile
#define TCLSID_IAudio CLSID_AudioDestFile
#endif

// these 2 control the audio destination ( to the wave file )
typedef TComInterface<TIAudioDest> TIWaveOut;
typedef TCoClassCreatorT<TIWaveOut, TIAudioDest, &TCLSID_IAudio,
&TIID_IAudio> TWaveCreator;

// these are for the speech engine
typedef TComInterface<ITTSFind> TITTSEnumerator;
typedef TCoClassCreatorT<TITTSEnumerator, ITTSFind,
&CLSID_TTSEnumerator,
&IID_ITTSFind> TEnumCreator;

typedef TComInterface<IVoiceText> TVoiceText;
typedef TCoClassCreatorT<TVoiceText, IVoiceText, &CLSID_VTxt,
&IID_IVoiceText> TVoiceTextCreator;

typedef TComInterface<ITTSCentral, &IID_ITTSCentral> TITTSCentral;

typedef TComInterface<ITTSAttributes, &IID_ITTSAttributes>
TITTSAttributes;

...

TIWaveOut WaveOut;
TITTSCentral pITTSCentral;
TITTSAttributes speed;

...
void __fastcall TWorker::ConnectTTS()
{
//TODO: Add your source code here

try {
WaveOut = TWaveCreator::Create();
TITTSEnumerator TTSEnum = TEnumCreator::Create();

TTSMODEINFO ttsResult; // final result
TTSMODEINFO ModeInfo;
memset( &ModeInfo, 0, sizeof( ModeInfo ) );
strcpy( ModeInfo.szModeName, "Mary (for Telephone)" );
// strcpy( ModeInfo.szModeName, "English-American: Shelley-Tel
(Adult Female for Telephone)" );
//"Adult Male #1, American English (TruVoice)" );
//"English-American: Reed-Tel (Adult Male for Telephone)" );

HRESULT hRes = TTSEnum->Find( &ModeInfo, NULL, &ttsResult );

if ( !SUCCEEDED( hRes ))
return;
// Pass off the audio file interface as an IUnknown (since it is
one)
// Should do select now

hRes = TTSEnum->Select( ttsResult.gModeID, &pITTSCentral, WaveOut
);
if ( !SUCCEEDED( hRes ) )
return;

pITTSCentral->AddRef();
speed = pITTSCentral;

DWORD sp = 0;
speed->SpeedGet( &sp );

// register so we get the notifications
std::auto_ptr<CTestNotify> tmp( new CTestNotify( &TAPICallback )
);
Notify = tmp;
pITTSCentral->Register( (void*)Notify.get(), IID_ITTSNotifySink,
&m_dwRegKey );
}
catch( ... ) {
ErrorCallback( NoTTS );
}
}

Note, that these are pieces of code, not a complete solution. But it
should give you a good start.

HTH,
Alex

Kow Kok Kiat wrote:
[snip]

Kow Kok Kiat

unread,
Dec 8, 1999, 3:00:00 AM12/8/99
to
I currently using the BCB 4 to use the ActiveX Control of the MS Speech SDK
4.0. I use one of the component which is call the TTS (TextToSpeech) as and
ActiveX Control, but I'm unable to get it work, which means I'm unable to
make the program work to translate what I've typed in to the speech. Anyone
of you know how to get this work? Thank you.

--
From: Kok Kiat

0 new messages