Share via


RecordMessageActivity.UseDefaultGrammars Property

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

Gets or sets whether default grammars are used during the action phase.

Namespace: Microsoft.SpeechServer.Dialog
Assembly: Microsoft.SpeechServer (in microsoft.speechserver.dll)

Syntax

'Declaration
<GlobalizedDescriptionAttribute("RecordMessageActivity_UseDefaultGrammars")> _
<DefaultValueAttribute(True)> _
<GlobalizedCategoryAttribute("SpeechCategory")> _
Public Property UseDefaultGrammars As Boolean
[GlobalizedDescriptionAttribute("RecordMessageActivity_UseDefaultGrammars")] 
[DefaultValueAttribute(true)] 
[GlobalizedCategoryAttribute("SpeechCategory")] 
public bool UseDefaultGrammars { get; set; }

Property Value

True if default grammars are used during the action (or confirmation) phase; otherwise False. The default value is True.

Remarks

The default action-phase grammars recognize the following commands:

  • accept

  • cancel

  • continue

  • play back

  • start over

If you use custom grammars instead of the default grammars, use the following methods to mimic the behavior of the preceding commands.

Method

Description

Abandon

Terminate the recording session.

Accept

Accept the recording.

Continue

Continue recording.

Replay

Play that material that has been recorded.

StartOver

Start recording again, overwriting anything that already been recorded.

Example

The following example creates an instance of the RecordMessageActivity class and sets a number of its properties. In the highlighted line of code, UseDefaultGrammars is set to its default value, True.

this.recordMessage = new Microsoft.SpeechServer.Dialog.RecordMessageActivity();
this.recordMessage.AudioEncoding = Microsoft.SpeechServer.Codec.Pcm8kHz16bit;
this.recordMessage.CanBargeIn = true;
this.recordMessage.EndSilenceTimeout = System.TimeSpan.Parse("00:00:01.5000000");
this.recordMessage.InitialSilenceTimeout = System.TimeSpan.Parse("00:00:01.5000000");
this.recordMessage.Name = "recordMessage";
this.recordMessage.PlayBeep = true;
this.recordMessage.SilenceTrimmedLength = System.TimeSpan.Parse("00:00:00.5000000");
this.recordMessage.TerminationDigits = Microsoft.SpeechServer.RecordTerminationDigits.None;
this.recordMessage.UseDefaultGrammars = true;
this.recordMessage.RecordTurnStarting += new System.EventHandler<Microsoft.SpeechServer.Dialog.TurnStartingEventArgs>(this.recordMessage_RecordTurnStarting);
this.recordMessage.ActionTurnStarting += new System.EventHandler<Microsoft.SpeechServer.Dialog.TurnStartingEventArgs>(this.recordMessage_ActionTurnStarting);
this.Activities.Add(this.recordMessage);

Thread Safety

All public static (Shared in Visual Basic) members of this type are thread-safe. Instance members are not guaranteed to be thread-safe.

Platforms

Development Platforms

Windows XP Professional with Service Pack 2 (SP2), Windows Server 2003, Windows Vista Ultimate Edition, Windows Vista Business Edition, Windows Vista Enterprise Edition

Target Platforms

Windows Server 2003

See Also

Reference

RecordMessageActivity Class
RecordMessageActivity Members
Microsoft.SpeechServer.Dialog Namespace
RecordMessageActivity.UseDefaultGrammarsProperty Field