Partager via


SPGRAMMAROPTIONS (SAPI 5.3)

Microsoft Speech API 5.3

SPGRAMMAROPTIONS

New in SAPI 5.3

Specifies the types of grammar options in a recognition context.

SPGRAMMAROPTIONS is a bit-field and hence can be combined into a DWORD using a bit-wise OR.

  
    typedef enum SPGRAMMAROPTIONS
{
    SPGO_SAPI,
    SPGO_SRGS,
    SPGO_SRGS_SCRIPT,
    SPGO_FILE,
    SPGO_HTTP,
    SPGO_RES,
    SPGO_OBJECT,
    SPGO_DEFAULT,
    SPGO_ALL
} SPGRAMMAROPTIONS;

Elements

  • SPGO_SAPI
    Enables support for the SAPI 5.1 grammar XML format.
  • SPGO_SRGS
    Enables support for the W3C SRGS grammar XML format.
  • SPGO_SRGS_SCRIPT
    Enables support for SRGS grammars to contain Jscript for semantic interpretation.
  • SPGO_FILE
    Grammars can be loaded from local and UNC file paths.
  • SPGO_HTTP
    Grammars can be loaded from HTTP and HTTPS URLs.
  • SPGO_RES
    Referenced grammars can be imported from a resource. This ONLY applies to referenced grammars (for example, those loaded by the ruleref tag). This flag has absolutely no effect on the LoadCmdFromResource function.
  • SPGO_OBJECT
    Referenced grammars can be imported from a COM object. This ONLY applies to referenced grammars. This flag has absolutely no effect on the LoadCmdFromObject function. NOTE: Our SRGS implementation has no means of referencing grammars in COM objects. This feature is only used with SAPI Grammar XML format or with grammars that are built at runtime by calling SAPI functions.
  • SPGO_DEFAULT
    By default, all options are enabled except scripting in SRGS.
  • SPGO_ALL
    All options are enabled.