Defining Additional Interfaces

An engine can provide additional functionality to an application by supporting custom interfaces. These can be used to expose features not yet supported by the text-to-speech API. To do this:

· Define an interface that follows the OLE COM and that contains all of the functions necessary to support the additional functionality.

· Provide marshaling for the interface so the engine can run in a different process than the calling application.

· Enable the engine to return a pointer to the interface when the engine receives a call of the IUnknown::QueryInterface member function for that interface.

· Provide documentation for the interface so that application developers can take advantage of it.

The main thread of any engine and audio object runs at the priority of the thread that created the engine or object. Following are four general rules that an engine should follow with regards to thread priorities:

1. An engine should not adjust the priority of the thread that created the engine.

2. A multithreaded engine may run one or more threads at a higher priority than its main thread.

3. An engine may check the priority of the calling thread for hints about what priority to use for the threads that the engine creates.

4. An engine should avoid boosting priorities except under the circumstances described in documentation included with the Microsoft Win32 Software Development Kit (SDK).