SrgsGrammarMode 列舉

定義

表示文法會比對的輸入類型,SrgsDocument 所定義。

public enum class SrgsGrammarMode
public enum SrgsGrammarMode
type SrgsGrammarMode = 
Public Enum SrgsGrammarMode
繼承
SrgsGrammarMode

欄位

Dtmf 1

SrgsDocument 物件將會比對類似常見於電話之撥號音的 DTMF 撥號音,而不比對語音。

Voice 0

SrgsDocument 物件會比對語音輸入。

範例

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 。 預設輸入模式為 Voice,表示所定義的文法 SrgsDocument 將符合語音輸入。

Dtmf 模式指出文法會比對 Dual-Tone 多頻率 (DTMF) 音而非語音。 有16個 DTMF 聲,通常在大部分的電話上都有12個。

當您從建立 Grammar 物件時 SrgsDocumentGrammar 物件會符合屬性所指定的輸入類型 Mode ,而該屬性會取得的實例 SrgsGrammarMode

適用於

另請參閱