AudioChannelTemplate.SendDirectionSamplingRate Property
Gets or sets the Sampling Rate for the send direction.
Namespace: Microsoft.Rtc.Collaboration.AudioVideo
Assembly: Microsoft.Rtc.Collaboration (in Microsoft.Rtc.Collaboration.dll)
Syntax
'Declaration
Public Property SendDirectionSamplingRate As AudioSamplingRate
Get
Set
'Usage
Dim instance As AudioChannelTemplate
Dim value As AudioSamplingRate
value = instance.SendDirectionSamplingRate
instance.SendDirectionSamplingRate = value
public AudioSamplingRate SendDirectionSamplingRate { get; set; }
Property Value
Type: Microsoft.Rtc.Collaboration.AudioVideo.AudioSamplingRate
Exceptions
Exception | Condition |
---|---|
ArgumentOutOfRangeException | Thrown when assigned value is not defined in enumerated type. |
Remarks
This restriction prevents the application from enabling audio formats on the send direction of the audio channel which are not enabled on the receive direction. Otherwise, allowing such a configuration might cause a failure in which media from the peer endpoint could not be received.
Examples
The following example changes SendDirectionSamplingRate and applies it to an AudioVideoFlow.
C# Modifying AudioChannelTemplate properties.
AudioVideoFlowTemplate templateToApply = new AudioVideoFlowTemplate(audioVideoFlow);
AudioChannelTemplate audioChannelTemplate = (AudioChannelTemplate)templateToApply.Audio.GetChannels()[ChannelLabel.AudioMono];
audioChannelTemplate.AllowedDirection = MediaChannelDirection.SendOnly;
audioChannelTemplate.SendDirectionSamplingRate = AudioSamplingRate.EightKhz;
// ApplyChanges
audioVideoFlow.BeginApplyChanges(
templateToApply,
new AsyncCallback(delegate(IAsyncResult result)
{
try
{
audioVideoFlow.EndApplyChanges(result);
}
catch (RealTimeException e)
{
// handle exception
throw e;
}
// ApplyChanges is done, verify changes result..
AudioChannel audioChannel = audioVideoFlow.Audio.GetChannels()[ChannelLabel.AudioMono];
if (audioChannel.Direction == MediaChannelDirection.SendOnly &&
audioChannel.SendDirectionSamplingRate == AudioSamplingRate.EightKhz)
{
// remote side accepted changes as they were
}
else
{
// remote side accepted changes but filtered them more.
}
}),
this);