AudioControl.GetChannels Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the audio channels.
public:
System::Collections::Generic::IDictionary<Microsoft::Rtc::Collaboration::AudioVideo::ChannelLabel, Microsoft::Rtc::Collaboration::AudioVideo::AudioChannel ^> ^ GetChannels();
public System.Collections.Generic.IDictionary<Microsoft.Rtc.Collaboration.AudioVideo.ChannelLabel,Microsoft.Rtc.Collaboration.AudioVideo.AudioChannel> GetChannels ();
member this.GetChannels : unit -> System.Collections.Generic.IDictionary<Microsoft.Rtc.Collaboration.AudioVideo.ChannelLabel, Microsoft.Rtc.Collaboration.AudioVideo.AudioChannel>
Public Function GetChannels () As IDictionary(Of ChannelLabel, AudioChannel)
Returns
Dictionary with with an AudioChannel indexed by its ChannelLabel.
Examples
The following example disconnects the call if audio channel direction changes to some value different than SendReceive or Inactive.
C# Getting AudioChannel and verifying its property.
audioVideoFlow.ConfigurationChanged += delegate(object sender, AudioVideoFlowConfigurationChangedEventArgs arg)
{
AudioVideoFlow avFlow = (AudioVideoFlow)sender;
// check directions
AudioChannel audioChannel = (AudioChannel)avFlow.Audio.GetChannels()[ChannelLabel.AudioMono];
if ((audioChannel.Direction != MediaChannelDirection.SendReceive)
&& (audioChannel.Direction != MediaChannelDirection.Inactive))
{
AudioVideoCall call = avFlow.Call;
call.EndTerminate(call.BeginTerminate(null, null));
}
};
Remarks
Returns a read-only dictionary of the channels held by AudioControl. Modification at the Dictionary will not have an effect, as the returned object is a copy of the original one.