Share via


RecordAudioActivity.LeadingSilenceTrimmedLength 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 the amount of leading silence that should be left after trimming.

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

Syntax

'Declaration
<GlobalizedCategoryAttribute("SpeechCategory")> _
<TypeConverterAttribute("Microsoft.SpeechServer.Authoring.DialogDesigner.ShortTimeSpanConverter, Microsoft.SpeechServer.Authoring.DialogDesigner, Version=2.0.3400.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35")> _
<DefaultValueAttribute(GetType(TimeSpan), "00:00:00.5")> _
<GlobalizedDescriptionAttribute("RecordAudioActivity_LeadingSilenceTrimmedLength")> _
Public Property LeadingSilenceTrimmedLength As TimeSpan
[GlobalizedCategoryAttribute("SpeechCategory")] 
[TypeConverterAttribute("Microsoft.SpeechServer.Authoring.DialogDesigner.ShortTimeSpanConverter, Microsoft.SpeechServer.Authoring.DialogDesigner, Version=2.0.3400.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35")] 
[DefaultValueAttribute(typeof(TimeSpan), "00:00:00.5")] 
[GlobalizedDescriptionAttribute("RecordAudioActivity_LeadingSilenceTrimmedLength")] 
public TimeSpan LeadingSilenceTrimmedLength { get; set; }

Property Value

The amount of leading silence to leave, in milliseconds.

Exceptions

Exception type Condition
ArgumentOutOfRangeException

An attempt is made to set LeadingSilenceTrimmedLength to a value less than TimeSpan.Zero.

Remarks

TimeSpan.Infinite means no trimming. Trimming never removes audio that occurs after SpeechDetected.

Example

The following code example shows the creation of a RecordAudioActivity instance, recordAudio. After recordAudio is created, a number of its properties are set. The highlighted line of code shows the LeadingSilenceTrimmedLength property being set to 0.5 second.

this.recordAudio = new Microsoft.SpeechServer.Dialog.RecordAudioActivity("RecordAudio");
this.recordAudio.AudioEncoding = Microsoft.SpeechServer.Codec.Pcm8kHz16bit;
this.recordAudio.CanBargeIn = false;
this.recordAudio.EndSilenceTimeout = System.TimeSpan.Parse("00:00:01.5000000");
this.recordAudio.InitialSilenceTimeout = System.TimeSpan.Parse("00:00:01.5000000");
this.recordAudio.LeadingSilenceTrimmedLength = System.TimeSpan.Parse("00:00:00.5000000");
this.recordAudio.PlayBeep = true;
this.recordAudio.TerminationDigits = Microsoft.SpeechServer.RecordTerminationDigits.None;
this.recordAudio.TrailingSilenceTrimmedLength = System.TimeSpan.Parse("00:00:00.5000000");
recordAudio.MainPrompt.SetText(GetPromptResource("recordAudio_MainPrompt"));
this.Activities.Add(this.recordAudio);

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

RecordAudioActivity Class
RecordAudioActivity Members
Microsoft.SpeechServer.Dialog Namespace
TrailingSilenceTrimmedLength
RecordAudioActivity.LeadingSilenceTrimmedLengthProperty Field