Partilhar via


GrammarSelectFunction Property

  Microsoft Speech Technologies Homepage

Gets or sets the name of a client-side function that is called before starting recognition. Read/write.

Usage

ASP.NET markup: <speech:Dtmf GrammarSelectFunction="..." />
Get value: String = Dtmf.GrammarSelectFunction;
Set value: Dtmf.GrammarSelectFunction = String;
Data type: String
Required: No

Remarks

The purpose of the GrammarSelectFunction script is to activate, deactivate or modify grammar elements used by client-side SALT dtmf elements, and to adjust speech recognition features such as confidence and rejection thresholds.

The value of the GrammarSelectFunction property is the name of a custom client-side script function, without parameters or parentheses. The client-side dialog manager calls this function, using the following syntax, before starting recognition.

The script block that contains this function should be placed before the control that calls the function. For more information, see "Placement of Script Blocks" in Authoring Notes.

Syntax

function FunctionName ( object dtmfTag)
{
     // Client-side code referenced by Dtmf.GrammarSelectFunction
}

Parameters

  • dtmfTag
    The client-side SALT dtmf object created by the Dtmf Dialog Speech Control.

Return Value

None.

Example

The following example demonstrates a GrammarSelectFunction that deactivates a grammar named "Grammar1."

<script>
  function GrammarSelector(tagD) {
    for(var child=0; child < tagD.childNodes.length; child++) {
      var childNode = tagD.childNodes.item(child);
      if(childNode.id.match( "^.*?Grammar1$" )) {
        tagD.Deactivate(childNode.id);
      }
    }
  }
</script>

See Also

Dtmf Class | Dtmf Constructor | Dtmf Members | Dtmf Properties | Dtmf Methods | Dtmf Events | Dtmf Remarks