Loads an SRGS grammar identified by an HGRAMMAR handle into a speech port for later use in a decode, DTMF decode or interpret text operation.
- int LV_SRE_LoadGrammarFromObject(HPORT hport, const char* gram_name, HGRAMMAR gram_handle)
The handle for the speech port you are loading the grammar into.
The identifier for the grammar being loaded. Whenever you activate, deactivate, or unload, this is the identifier you will use.
An HGRAMMAR handle created by LVGrammar_Create and subsequently initialized with either LVGrammar_LoadGrammar or LVGrammar_LoadGrammarFromBuffer.
No errors; this grammar is now ready to use.
The grammar provided was not fully conforming, but it was understandable and is now ready for use.
The input hport is not a valid one.
The operation may have failed because the port was shutting down or the vocab size of the grammar is zero. The error also occurs when an internal failure has occurred, may be out of resources.
The license associated with the port has been invalidated.
Either gram_name is NULL or gram_handle is invalid.
Sending the grammar to the ASR server timed out.
Either the tag-format specified in the grammar is not supported or the grammar provided was not understandable to the grammar compiler.
There are no ASR servers available to load and compile the grammar.
The connected ASR server(s) do not support the language of the grammar being loaded.
An exception occurred while processing the request.
Detailed error and warning messages are sent to the speech port's logging callback function at priorities 0 and 1, respectively.
It is possible that some of the above return codes may get returned for different underlying reasons. Use LV_SRE_ReturnGrammarErrorString to obtain a description of the actual reason for failure.