Partager via


SPCFGRULEATTRIBUTES (SAPI 5.4)

Microsoft Speech API 5.4

SPCFGRULEATTRIBUTES

SPCFGRULEATTRIBUTES indicates the attributes of grammar rules, such as whether the rule is top-level, active, etc.

  
    typedef enum SPCFGRULEATTRIBUTES
{
    SPRAF_TopLevel,
    SPRAF_Active,
    SPRAF_Export,
    SPRAF_Import,
    SPRAF_Interpreter,
    SPRAF_Dynamic,
    SPRAF_Root,
    SPRAF_AutoPause,
    SPRAF_UserDelimited
} SPCFGRULEATTRIBUTES;

The SPRAF_AutoPause and SPRAF_UserDelimited flags are only valid at run-time as part of a rule state and are not valid to pass as part of a rule definition.

Elements

  • SPRAF_TopLevel
    Flag specifying that the rule is defined as a top-level rule. Top-level rules are the entry points into the grammar and can be de-/activated programmatically. This can be set using the TOPELVEL attribute in the Speech Text Grammar Format.
  • SPRAF_Active
    Flag specifying that the rule is defined as a top-level rule that is activated by default. These rules can be de-/activated by calling De-/ActivateRule(NULL, 0, ...). This can be set using the TOPLEVEL="ACTIVE" attribute-value pair in the Speech Text Grammar Format.
  • SPRAF_Export
    Flag specifying that the rule is exported and hence can be referred to by a rule in another grammar. This can be set using the EXPORT="YES" attribute-value pair in the Speech Text Grammar Format.
  • SPRAF_Import
    Flag specifying that the rule is imported from another grammar and is therefore not defined in this grammar.
  • SPRAF_Interpreter
    Flag specifying that the rule has an interpreter (custom C/C++ code implementing the ISpCFGInterpreter interface) associated with it.
  • SPRAF_Dynamic
    Flag specifying that the rule is dynamic (can be changed programmatically through the ISpGrammarBuilder interface). Note that the CFG must be loaded with the SPLO_DYNAMIC flag to enable changes at run time.
  • SPRAF_Root
    Flag specifying whether this is the root rule in the grammar. This is only meaningful for SRGS grammars.
  • SPRAF_AutoPause
    Flag specifying the grammar attributes as AutoPause. This flag is only valid at run time as part of a rule state and is not valid to pass as part of a rule definition.
  • SPRAF_UserDelimited
    indicates that the audio will start when the user starts speaking and will end when the user stops speaking.