Share via


Note

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

Microsoft Speech Platform

ISpRecoGrammar2::LoadCmdFromFile2

ISpRecoGrammar2::LoadCmdFromFile2 loads an XML-format grammar that conforms to the Speech Recognition Grammar Specification (SRGS) Version 1.0 from a file and extends the ISpRecoGrammar::LoadCmdFromFile function.

<pre IsFakePre="true" xmlns="http://www.w3.org/1999/xhtml"> <strong>HRESULT LoadCmdFromFile2(</strong> <strong> LPCWSTR</strong> <em>pszFileName</em>, <strong> <a runat="server" href="jj127470(v=msdn.10).md">SPLOADOPTIONS</a></strong> <em>Options</em>, <strong> LPCWSTR</strong> <em>pszSharingUri</em>, <strong> LPCWSTR</strong> <em>pszBaseUri</em> <strong>);</strong> </pre>

Parameters

  • pszFileName
    The file name of the grammar.
  • Options
    Flag of type SPLOADOPTIONS indicating whether the grammar will be modified dynamically.
  • pszSharingUri
    Indicates that it is a dynamic shared grammar. Other grammars in the same recognizer can reference this grammar at runtime using this URI.
  • pszBaseUri
    The base path that any relative rule references within the grammar are resolved against.

Return Values

Value Description
S_OK Function completed successfully.
E_INVALIDARG One of the parameters is invalid.
FAILED(hr) Appropriate error message.