ISpSREngineSite::GetTransitionProperty (SAPI 5.3)

Speech API 5.3
Microsoft Speech API 5.3


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

HRESULT GetTransitionProperty(


[in] The transition identifier.
[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

S_OKFunction completed successfully and transition has a property.
S_FALSEFunction completed successfully but transition does not have a property.
E_INVALIDARGOne or more parameters are invalid.
E_OUTOFMEMORYExceeded available memory.
FAILED(hr)Appropriate error message.


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.