Browse
 
Tools
Rss Categories

LVSpeechPort::ActivateGlobalGrammar (Deprecated)

Reference Number: AA-00743 Views: 7970 0 Rating/ Voters

  You only need to use this function if you have a grammar in the speech port with same name as a grammar in the global space, and you wish to activate the global grammar.

Function

  • int LVSpeechPort::ActivateGlobalGrammar(const char* gram_name);

Parameters

gram_name

  The identifier for the grammar being activated.  This is the same identifier that was given to the grammar when it was loaded.

Return Values

LV_SUCCESS

No errors; this grammar is now active.

LV_FAILURE

  This grammar could not be activated, because the port was shutting down.

LV_INVALID_GRAMMAR_LABEL

  The input gram_name specifies a grammar that is not available for activation (either not loaded or has been unloaded).

LV_INVALID_HPORT

  The port is not valid (either CreateClient has not been called or DestroyClient has been called prior to this call).

        

LV_EXCEPTION

         An exception occurred while processing the request.         

Remarks

  Since LVSpeechPort::ActivateGrammar searches the speech port's loaded grammars, and then searches the application level grammars, you only need to use LV_SRE_ActivateGlobalGrammar if there is a name conflict between your local and app-level grammars, and you need to activate the app-level one.

Detailed error and warning messages are sent to the speech port's logging callback function at priorities 0 and 1, respectively.

NOTE: As of LumenVox version 12.1, the use of "Global" grammars, and related functions has been deprecated. There is no longer any benefit from using global grammars (assigned at the application level) due to the advanced grammar caching mechanism that has been in place for some time.  Users should adopt the use of port-assigned grammar functions (basically consisting of the same name, but without the 'Grammar' portion)

See Also