Using a custom audio driver
You can define a custom audio device, to supply audio to all publishers in the client and to handle the mixed audio stream from all streams the client subscribes to.
A custom audio device is represented by an otc_audio_device struct.
And an otc_audio_device_callbacks struct includes function pointers to functions that act as the audio-related callbacks that the Vonage Video Linux SDK invokes.
Setting the audio volume for a subscriber
You can individually set the audio volume for each subscriber by calling the otc_subscriber_set_audio_volume() function.
To fine tune audio quality for a publisher stream the following methods can be used:
Audio bitrate
otc_publisher_set_max_audio_bitrate(otc_publisher* publisher, uint32_t bitrate);
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). If you do not set this option, Vonage automatically assigns an audio bitrate for the stream.
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
Disable Audio Processing
otc_publisher_settings_set_disable_audio_processing (otc_publisher_settings* settings, otc_bool disabled);
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. The default value is false.
Automatic Gain Control
otc_publisher_settings_set_auto_gain_control(otc_publisher_settings* settings, otc_bool enabled);
Whether to enable automatic gain control for the published audio. You may want to set this to false when publishing high-quality audio. The default value is true. This setting is ignored if you disable audio processing.
Echo Cancellation
otc_publisher_settings_set_echo_cancellation(otc_publisher_settings* settings, otc_bool enabled);
Whether to enable echo cancellation for the published audio. You may want to set this to false when publishing high-quality audio. The default value is true. This setting is ignored if you disable audio processing
Noise Suppression
otc_publisher_settings_set_noise_suppression(otc_publisher_settings* settings, otc_bool enabled);
Whether to enable noise suppression for the published audio. You may want to set this to false when publishing high-quality audio. The default value is true. This setting is ignored if you if you disable audio processing.
Stereo
otc_publisher_settings_set_stereo(otc_publisher_settings* settings, otc_bool enabled);
Whether to publish stereo audio. The default value is false.
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.