SrgsGrammarMode Výčet
Definice
Důležité
Některé informace platí pro předběžně vydaný produkt, který se může zásadně změnit, než ho výrobce nebo autor vydá. Microsoft neposkytuje žádné záruky, výslovné ani předpokládané, týkající se zde uváděných informací.
Určuje typ vstupu, který se bude shodovat s gramatikou definovanou SrgsDocument.
public enum class SrgsGrammarMode
public enum SrgsGrammarMode
type SrgsGrammarMode =
Public Enum SrgsGrammarMode
- Dědičnost
Pole
| Name | Hodnota | Description |
|---|---|---|
| Voice | 0 | Objekt SrgsDocument bude odpovídat vstupu řeči. |
| Dtmf | 1 | Objekt SrgsDocument se bude shodovat s tóny DTMF podobnými tónům nalezeným na telefonu místo řeči. |
Příklady
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);
Poznámky
Vstupní režim pro objekt SrgsDocument je určen jeho Mode vlastností. Výchozí vstupní režim je Hlas, který označuje, že gramatika definovaná objektem SrgsDocument bude odpovídat vstupu řeči.
Režim Dtmf označuje, že gramatika bude odpovídat Dual-Tone vícefrekvenčním tónům (DTMF) místo řeči. Na většině telefonů se běžně vyskytuje 16 tónů DTMF, z nichž 12 se běžně vyskytuje.
Když vytvoříte objekt z objektu , bude objekt odpovídat typu vstupu určeného Grammar vlastností, který získá instanci SrgsDocument.GrammarModeSrgsGrammarMode