Share via


ISpSREngineSite::GetTransitionProperty (SAPI 5.3)

Microsoft Speech API 5.3

ISpSREngineSite::GetTransitionProperty

ISpSREngineSite::GetTransitionProperty retrieves semantic property information for a transition in a grammar.

  
    HRESULT GetTransitionProperty(
   SPTRANSITIONID           ID,
SPTRANSITIONPROPERTY   **ppCoMemProperty
);

Parameters

  • ID
    [in] The transition identifier.
  • ppCoMemProperty
    [out] Address of a pointer to a SPTRANSITIONPROPERTY that receives the property information. Applications calling this method must call CoTaskMemFree() to free memory returned. If the transition does not have a semantic property, this will be set to point to NULL, and S_FALSE will be returned.

Return values

Value
S_OK
S_FALSE
E_INVALIDARG
E_OUTOFMEMORY
FAILED(hr)

Remarks

CFG grammars can contain properties (also known as 'semantic tags') within a grammar. This provides a means for semantic information to be embedded inside a grammar.

By default, the engine does not recognize these properties. Typically, an engine will recognize only the speech from the words in the grammar, and SAPI will parse and add the property information in the ISpSREngineSite::ParseFromTransitions call. However, it is possible for an engine to recognize this information by calling this method on any transition. If there is a property on this transition, the property name or ID and value is returned in the SPTRANSITIONPROPERTY structure, which must be freed after each use using CoTaskMemFree.

An engine can find out if a transition has a semantic property attached before calling this method by looking at the fHasProperty flag in the SPTRANSITIONENTRY structure associated with this transition.