Windows

Using a custom audio driver

By default, the Vonage Video Windows SDK uses the device microphone to capture audio to transmit to a published stream. And it uses the and speakers (or headphones) to play back audio from a subscribed stream. You can implement a custom audio driver to read and write audio data for subscribers and publishers.

Create an implementation the IAudioDevice interface and its methods. The IAudioDevice.InitAudio(AudioDevice.AudioBus audioBus) method is called when the AudioDevice is initialized. Use the AudioBus object, passed into that method, to read write audio data, with its ReadRenderData(buffer, numberOfSamples) and WriteCaptureData(buffer, numberOfSamples) methods.

Reducing audio bandwidth with Opus DTX

Opus DTX (Discontinuous Transmission) is an audio codec that can reduce the bandwidth usage when a participant is not speaking. This can be useful in large sessions with many audio participants.

You enable Opus DTX by setting the OpusDtx property of the Publisher.Builder object you use when creating a Publisher to true.

For more information, see this Vonage Video API knowledge base article.

Setting the audio volume for a subscriber

You can individually set the audio volume for each subscriber by calling the Subscriber.AudioVolume property.

Tuning audio quality

The Publisher.Builder class includes properties for tuning audio quality. This lets you publish streams that use high-quality (or lower quality) audio:

AudioBitrate (Number) — The desired bitrate for the published audio, in bits per second. The supported range of values is 6,000 - 510,000. (Invalid values are ignored.) Set this value to enable high-quality audio (or to reduce bandwidth usage with lower-quality audio).

The following are recommended settings:

  • 8,000 - 12,000 for narrowband (NB) speech
  • 16,000 - 20,000 for wideband (WB) speech
  • 28,000 - 40,000 for full-band (FB) speech
  • 48,000 - 64,000 for full-band (FB) music

If you do not set this option, Voange automatically sets the audio bitrate for the stream.

AutoGainControl (Boolean) — Whether to enable automatic gain control for the published audio. You may want to set this to false when publishing high-quality audio (by setting the AutoGainControl property of the Publisher.Builder). The default value is true. This setting is ignored if you set DisableAudioProcessing to true (which disables echo cancellation, automatic gain control, and noise suppression for the published stream).

DisableAudioProcessing (Boolean) — Whether to disable echo cancellation, automatic gain control, and noise suppression for the published audio. You may want to set this to true when publishing high-quality audio (by setting the DisableAudioProcessing property of the Publisher.Builder). The default value is false.

EchoCancellation (Boolean) — Whether to enable echo cancellation for the published audio. You may want to set this to false when publishing high-quality audio (by setting the EchoCancellation property of the Publisher.Builder). The default value is true. This setting is ignored if you set DisableAudioProcessing to true (which disables echo cancellation, automatic gain control, and noise suppression for the published stream).

Stereo (Boolean) — Whether to publish stereo audio. The default value is false.

NoiseSuppression (Boolean) — Whether to enable noise suppression for the published audio. You may want to set this to false when publishing high-quality audio (by setting the NoiseSuppression property of the Publisher.Builder). The default value is true. This setting is ignored if you set DisableAudioProcessing to true (which disables echo cancellation, automatic gain control, and noise suppression for the published stream).

Adjusting audio and video

Learn more about manipulating audio and video of Vonage Video API streams for your application. Publish only video or audio, adjust the frame rate, and more.

手順
1
Introduction
2
Prerequisites
3
Adjusting audio and video
4
Adjusting video settings
5
Adjusting audio settings
6
Subscribing to audio or video only
7
Detecting audio or video
8
What's next?