Share via


RecordAudioActivity.TrailingSilenceTrimmedLength 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 trailing silence that should be left after trimming.

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

Syntax

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

Property Value

The amount of trailing silence, in milliseconds, that should be left after trimming.

Exceptions

Exception type Condition
ArgumentOutOfRangeException

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

Remarks

TimeSpan.Infinite means no trimming. Trimming never removes audio that occurs before the end of speech.

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 TrailingSilenceTrimmedLength property being set to 0.5 second.

this.recordAudio = new Microsoft.SpeechServer.Dialog.RecordAudioActivity();
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.Name = "RecordAudio";
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
RecordAudioActivity.LeadingSilenceTrimmedLength Property
RecordAudioActivity.TrailingSilenceTrimmedLengthProperty Field