Velocity API: voice.unloadgrammars

Version 1

    Return To Index

    Voice.unloadGrammars()

    Overview

    Stops the engine from listening for the terms in the specified grammar file or files.

    Added in version 1.2.104

    Use Cases

    • You want to stop speech recognition for specific grammars.

    Remarks

    You cannot remove grammars that handle the default voice-enabled shortcuts in context menus.

    Format

     

    Voice.unloadGrammars(grammar);
    ParameterDescriptionTypeRequiredNotes
    grammarFile name of a BNF resource.StringRequiredTo remove more than one grammar at a time, separate the names with a comma. You do not need to specify the file extension.

     

    Example 1

    /* Removing one grammar 
    */
      
    voice.loadGrammars('connected_digits');
    .
    .
    .
    Voice.unloadGrammars('connected_digits');

    Example 2

    /* Removing more than one grammar 
    */
      
    Voice.loadGrammars('connected_digits', 'yes_no');
    .
    .
    .
    Voice.unloadGrammars('connected_digits', 'yes_no');