Adjusting Application Performance

Adjusting Application Performance

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.

Because codecs have varying performance characteristics, Microsoft Unified Communications Managed API 2.0 Core SDK exposes the UseHighPerformance property, which enables developers to choose between better server performance or better audio quality for their applications. UseHighPerformance is a property on the AudioChannelTemplate class in the Microsoft.Rtc.Collaboration.AudioVideo namespace.

Setting the UseHighPerformance property to true causes the UCMA 2.0 Core SDK platform to exclude lower-performance audio codes such as RTAudio-WB and RTAudio-NB. Setting the property to false causes the platform to include lower-performance audio codecs such as RTAudio-WB or RTAudio-NB.

Performance gain comes from reducing the time spent encoding and decoding audio, of which the more time-expensive operation is encoding. Encoding is particularly expensive with RTAudio. The UseHighPerformance setting limits the choice of codes to those that can more quickly encode and decode audio packets.

For UCMA 2.0 Core SDK applications that require optimal server performance and scalability, set the UseHighPerformance property to true.

The following code shows a handler for the AudioVideoFlowConfigurationRequested event on an AudioVideoCall instance. The handler can be used for incoming and outgoing audio/video calls. In this code example, the UseHighPerformance property is set to true, thereby selecting server performance over audio quality.

private void UserAvCall_AudioVideoFlowConfigurationRequested(object sender, AudioVideoFlowConfigurationRequestedEventArgs e)
{
  AudioVideoCall call = sender as AudioVideoCall;
  AudioVideoFlowTemplate template = new AudioVideoFlowTemplate(call.Flow);

  // Set High Performance
  template.Audio.Channels[ChannelLabel.AudioMono].UseHighPerformance = true;
  call.Flow.Initialize(template);
}
Show:
© 2016 Microsoft