Share via


Note

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

Microsoft Speech Platform

ISpRecoContext::SetMaxAlternates

ISpRecoContext::SetMaxAlternates sets the maximum number of alternates that the speech recognition engine will return for context-free grammars (CFGs) associated with this context.

<pre IsFakePre="true" xmlns="http://www.w3.org/1999/xhtml"> <strong>HRESULT SetMaxAlternates(</strong> <strong> ULONG</strong> <em>cAlternates</em> <strong>);</strong> </pre>

Parameters

  • cAlternates
    [in] Specifies the maximum number of alternates the engine will return.

Return Values

Value Description
S_OK Function completed successfully.
FAILED(hr) Appropriate error message.

Remarks

By default, the engine returns zero recognition alternates, so an application must call ::SetMaxAlternates to retrieve alternates. The value of cAlternates is the maximum number of recognition alternates that will be returned to the application.