Text-to-Speech Enumerator

To create a text-to-speech enumerator, an application calls the CoCreateInstance function with the CLSID_TTSEnumerator class identifier and the IID_ITTSFind interface identifier. This creates a text-to-speech enumeration object with an ITTSFind interface that the application can use to find an engine.

After creating the text-to-speech enumerator and getting the address of its ITTSFind interface, the application fills a TTSMODEINFO structure with values that indicate the kind of engine the application is looking for, such as the language, the dialect, the engine features needed, the engine name, and so on. Any members of the TTSMODEINFO structure that are not relevant to the application can be set to NULL. The application then calls the ITTSFind::Find member function.

If Find succeeds, it fills a second TTSMODEINFO structure with information about the closest matching text-to-speech capabilities available. Because this is only the closest match, an application should check the mode to see if it is acceptable. If it is not, the application can enumerate all modes supported by all engines in the system in an attempt to find an acceptable mode, or the application can fail.

An application can rank certain mode characteristics as more or less important than the engine's default rankings by filling a TTSMODEINFORANK structure that indicates the priority of each TTSMODEINFO member. The application specifies the address of the TTSMODEINFORANK structure along with the TTSMODEINFO structure when using Find.