SpeechGrammarSet.AddGrammarFromPredefinedType method

Applies to Windows Phone only

Creates a SpeechGrammar object by using a pre-defined grammar type, and adds it to the speech grammar set.

Syntax


Public Function AddGrammarFromPredefinedType(
  key As String,  
  predefinedGrammarType As SpeechPredefinedGrammar 
) As SpeechGrammar

Parameters

key

Type: System.String [.NET] | Platform::String [C++]

The name of the grammar.

predefinedGrammarType

Type: SpeechPredefinedGrammar

The predefined grammar type that is used when creating the SpeechGrammar object.

Return value

Type: SpeechGrammar

The grammar that is added to the speech grammar set.

Remarks

Only one pre-defined grammar type can be active at a time. This means that if you have called the AddGrammarFromPredefinedType method with a dictation or web search grammar, and then call the method again with the other pre-defined grammar type, an SPERR_GRAMMARSET_CANT_ADD error returns. To avoid this error, you can call the Clear method before switching to a new pre-defined grammar type.

For more information about how to use the AddGrammarFromPredefinedType method, see the Working with web search grammars section of Adding, loading, and preloading grammars for Windows Phone .

Requirements

Minimum supported client

None supported

Minimum supported server

None supported

Minimum supported phone

Windows Phone 8

End of phone support

Windows Phone 8.1 [Windows Phone Silverlight 8.1 apps only]

Namespace

Windows.Phone.Speech.Recognition
Windows::Phone::Speech::Recognition [C++]

Metadata

Windows.winmd

Capabilities

ID_CAP_SPEECH_RECOGNITION [Windows Phone]
ID_CAP_MICROPHONE [Windows Phone]
ID_CAP_NETWORKING [Windows Phone]

See also

SpeechGrammarSet

 

 

Community Additions

ADD
Show:
© 2014 Microsoft