Note

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

Microsoft Speech Platform

ISpRecoGrammar::SetWordSequenceData

ISpRecoGrammar::SetWordSequenceData sets a word sequence buffer in the speech recognition (SR) engine. Applications built on the Speech Platform will typically not use this method.

<pre IsFakePre="true" xmlns="http://www.w3.org/1999/xhtml"> <strong>HRESULT SetWordSequenceData(</strong> <strong> [annotation("__in_ecount_opt(cchText)")] const WCHAR</strong> *<em>pText</em>, <strong> ULONG</strong> <em>cchText</em>, <strong>const</strong> <a runat="server" href="jj127887(v=msdn.10).md"><strong>SPTEXTSELECTIONINFO</strong></a> *<em>pInfo</em> <strong>);</strong> </pre>

Parameters

  • pText
    [in] Buffer containing the text to search for possible word sequences. The buffer is double-NULL terminated. The whole buffer could be separated into different groups by '\0'. Any sub-sequence of words in the same group is recognizable, any sub-sequence of words across different groups is not recognizable. The SR engines determine where to break words and when to normalize text for better performance. For example, if the buffer displays: "please play\0this new game\0\0", "please play" is recognizable, while "this new game" is not recognizable.
  • cchText
    [in] The number of characters (WCHAR) in pText, including null terminators. Because pText should be a double-null-terminated string, the value of cchText should include any internal null terminators and the ending double-null terminators.
  • pInfo
    [optional, in] Address of the SPTEXTSELECTIONINFO structure that contains the selection information. If NULL, the SR engine will use the entire contents of pText.

Return Values

Value Description
S_OK Function completed successfully.
E_INVALIDARG One or more parameters are invalid.
FAILED(hr) Appropriate error message.

Remarks

The command and control grammar can refer to any sub-sequence of words in this buffer using the SPRULETRANS_TEXTBUFFER special transition type in ISpGrammarBuilder::AddRuleTransition().