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)
Visual Basic (Declaration)
Public Sub AppendDictation
Dim instance As GrammarBuilder
instance.AppendDictation()
public void AppendDictation()
public:
void AppendDictation()
public function AppendDictation()
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.
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);
}
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.
.NET Framework
Supported in: 3.5, 3.0
Reference