Object Creation

To create a voice-text object, an application calls the CoCreateInstance function with the CLSID_VTxt class identifier and the IID_IVoiceText interface identifier. An application must create a voice-text object for each audio destination that it needs to use. For example, if the application needs to play voice text over a telephone line as well as the computer speakers, it should create two voice-text objects.

After creating a voice-text object, CoCreateInstance returns a pointer to the IVoiceText interface for the object. An application uses the interface to register itself with the text-to-speech engine, to send text to the text-to-speech engine, and to control how the engine speaks the text.

Before an application can play voice text, it must register itself by calling the IVoiceText::Register member function. By registering, the application tells the engine which site to use as the destination of voice text and passes the voice-text object a pointer to the application's voice-text notification interface. The object calls the notification interface to notify the application about events related to voice text.