Share via


Note

Please see Azure Cognitive Services for Speech documentation for the latest supported speech solutions.

Microsoft Speech Platform

ISpObjectTokenCategory::EnumTokens

ISpObjectTokenCategory::EnumTokens enumerates the tokens for the category by attempting to match specified attributes. See Using Object Tokens and Categories for information about using tokens, their attributes, and categories to discover and use resources for speech recogntion and text-to-speech installed on a computer.

<pre IsFakePre="true" xmlns="http://www.w3.org/1999/xhtml"> <strong>HRESULT EnumTokens(</strong> <strong> LPCWSTR </strong> *<em>pszReqAttribs</em>, <strong> LPCWSTR </strong> *<em>pszOptAttribs</em>, <strong> IEnumSpObjectTokens </strong> **<em>ppEnum</em> <strong>);</strong> </pre>

Parameters

  • pszReqAttribs
    [in] The null terminated string of required attributes for the token.
  • pszOptAttribs
    [in] The null terminated string of optional attributes for the token. The order in which the tokens are listed in ppEnum is based on the order they match pszOptAttribs.
  • ppEnum
    [out] The enumerated list of tokens found.

Return Values

Value Description
S_OK Function completed successfully.
SPERR_UNINITIALIZED Data key interface is not initialized.
E_POINTER At least one of the parameters is invalid or bad.
FAILED(hr) Appropriate error message.

Example

pszReqAttribspszOptAttribs

`

// Declare local identifiers:
HRESULT                           hr = S_OK;
CComPtr<ISpObjectTokenCategory>   cpSpObjectTokenCategory;
CComPtr<IEnumSpObjectTokens>      cpSpEnumTokens;

hr = SpGetCategoryFromId(SPCAT_VOICES, &cpSpObjectTokenCategory;);

if (SUCCEEDED (hr)) { hr = cpSpObjectTokenCategory->EnumTokens(NULL, NULL, &cpSpEnumTokens;); }

if (SUCCEEDED(hr)) { // Do stuff here. }

`