SrgsGrammarMode SrgsGrammarMode SrgsGrammarMode SrgsGrammarMode Enum

定义

指示由 SrgsDocument 定义的符合语法的输入的类型。Indicates the type of input that the grammar, defined by the SrgsDocument, will match.

public enum class SrgsGrammarMode
public enum SrgsGrammarMode
type SrgsGrammarMode = 
Public Enum SrgsGrammarMode
继承
SrgsGrammarModeSrgsGrammarModeSrgsGrammarModeSrgsGrammarMode

字段

Dtmf Dtmf Dtmf Dtmf 1

SrgsDocument 与 DTMF 语气匹配的对象类似于电话中找到的,而不是语音。The SrgsDocument object will match DTMF tones similar to those found on a telephone, instead of speech.

Voice Voice Voice Voice 0

SrgsDocument 将与语音输入匹配的对象。The SrgsDocument object will match speech input.

示例

string srgsDocumentFile = Path.Combine(Path.GetTempPath(), "srgsDocumentFile.xml");  
SrgsDocument document = null;  
GrammarBuilder builder = null;  
Grammar grammar = null;  
  
Choices firstThree = new Choices(new string[] {"1", "2", "3"});  
Choices nextThree = new Choices(new string[] {"4", "5", "6"});  
Choices lastThree = new Choices(new string[] {"7", "8", "9"});  
  
Choices keyPadChoices = new Choices(new GrammarBuilder[] {firstThree, nextThree, lastThree, new Choices("0")});  
  
builder = new GrammarBuilder(keyPadChoices);  
document = new SrgsDocument(builder);  
  
document.Mode = SrgsGrammarMode.Dtmf;  
grammar = new Grammar(document);   

注解

的输入模式SrgsDocument由其Mode属性确定。The input mode for an SrgsDocument is determined by its Mode property. 默认输入模式为 Voice, 这表示由SrgsDocument定义的语法将匹配语音输入。The default input mode is Voice, which indicates that the grammar defined by the SrgsDocument will match speech input.

Dtmf 模式指示语法将匹配双音频多频率 (DTMF) 音而不是语音。The Dtmf mode indicates that a grammar will match Dual-Tone Multi-Frequency (DTMF) tones instead of speech. 有16个 DTMF 音, 其中有12个, 通常在大多数电话上都找到。There are 16 DTMF tones, 12 of which are commonly found on most telephones.

Grammar当你Grammar Mode从创建对象时SrgsGrammarMode, 对象将与属性指定的输入类型匹配, 后者将获取的实例。 SrgsDocumentWhen you create a Grammar object from an SrgsDocument, the Grammar object will match the type of input specified by the Mode property, which gets an instance of SrgsGrammarMode.

适用于

另请参阅