Processing Buffer Notifications

The text-to-speech engine object calls an application's ITTSBufNotifySink interface to inform the application of buffer-related events so that the application can respond to them. To receive notifications, the application must create a COM object that supports the ITTSBufNotifySink interface and must pass the address of the interface to the engine object when calling the ITTSCentral::TextData member function.

The ITTSBufNotifySink interface consists of a set of member functions that correspond to buffer-related events. When an event occurs, the engine object calls the member function that corresponds to the event.

The following example shows how to define an object class that implements the ITTSBufNotifySink interface.

class CBufNotify : public ITTSBufNotifySink {

private:

public:

CBufNotify(void);

~CBufNotify(void);

// IUnknown members

STDMETHODIMP QueryInterface (REFIID, LPVOID FAR *);

STDMETHODIMP_(ULONG) AddRef(void);

STDMETHODIMP_(ULONG) Release(void);

// ITTSNotifySink

STDMETHOD (BookMark) (QWORD, DWORD);

STDMETHOD (TextDataDone) (QWORD, DWORD);

STDMETHOD (TextDataStarted) (QWORD);

STDMETHOD (WordPosition) (QWORD, DWORD);

};

typedef CBufNotify * PCBufNotify;