This documentation is archived and is not being maintained.

SrgsGrammarMode Enumeration

Indicates the type of input that the Grammar object can expect.

Namespace: System.Speech.Recognition.SrgsGrammar
Assembly: System.Speech (in system.speech.dll)

public enum SrgsGrammarMode
public enum SrgsGrammarMode
public enum SrgsGrammarMode

 Member nameDescription
DtmfThe Grammar object should expect DTMF tones similar to those found on a telephone. 
VoiceThe Grammar object should expect spoken audio data. 

The default mode for speech recognition grammars is Voice. There are 16 DTMF tones, 12 of which are commonly found on most telephones.

Although the Mode attribute is used to inform the Grammar object of the type of input to expect, it is not exposed by that object. To set the mode, a SrgsDocument must be created and a Grammar object can be instantiated with the resulting SrgsDocument object.

string srgsDocumentFile = Path.Combine(Path.GetTempPath(), "srgsDocumentFile.xml");
SrgsDocument document = null;
GrammarBuilder builder = null;
Grammar grammar = null;

Choices firstThree = new Choices("1", "2", "3");
Choices nextThree = new Choices("4", "5", "6");
Choices lastThree = new Choices("7", "8", "9");

Choices keyPadChoices = new Choices(firstThree, nextThree, lastThree, new Choices("0"));

builder = new GrammarBuilder(keyPadChoices);
document = new SrgsDocument(builder);

document.Mode = SrgsGrammarMode.Dtmf;
grammar = new Grammar(document;

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0