.NET Framework Class Library
GrammarBuilder..::.AppendDictation Method

Appends grammar logic to provide access the default free text dictation grammar provided by the Speech platform.

Namespace:  System.Speech.Recognition
Assembly:  System.Speech (in System.Speech.dll)
Syntax

Visual Basic (Declaration)
Public Sub AppendDictation
Visual Basic (Usage)
Dim instance As GrammarBuilder

instance.AppendDictation()
C#
public void AppendDictation()
Visual C++
public:
void AppendDictation()
JScript
public function AppendDictation()
Remarks

GrammarBuilder with dictation grammar appended using the AppendDictation()()() method can be freely intermixed without restriction GrammarBuilder instance specifying exact semantics.

Such as GrammarBuilder can be used freely with SemanticResultValue and SemanticResultKey.

Examples

The example below creates a Grammar emulating a Dictaphone from GrammarBuilder instances by inserting a GrammarBuilder with dictation grammar appended with the AppendDictation method between to GrammarBuilder objects, supporting the commadns “start dictation” and “stop dictation”. The dictation result will be obtainable from the Value property of SemanticValue instance returned with a recognized phrase and accessed with the tag “DicationInput”.

private void dictaphone(){
    GrammarBuilder dictaphoneGB = new GrammarBuilder();
    GrammarBuilder dictation = new GrammarBuilder();
    dictation.AppendDictation();
    
    dictaphoneGB.Append(new SemanticResultKey("StartDictation", new SemanticResultValue("Start Dictation",true)));
    dictaphoneGB.Append(new SemanticResultKey("DictationInput", dictation));
    dictaphoneGB.Append(new SemanticResultKey("EndDictation", new SemanticResultValue("End Dictation", false)));
    Grammar grammar=new Grammar(dictaphoneGB);
    grammar.Enabled=true;
    grammar.Name="Dictatphone ";
    _recognizer.LoadGrammar(grammar);
   
}
.NET Framework Security

Platforms

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Version Information

.NET Framework

Supported in: 3.5, 3.0
See Also

Reference

Tags :


Page view tracker