Skip to main content
Version: 5.5

Volume control

PlanetKit controls peer volume in a number of ways. Each control method affects each other. This page describes how to control peer volume appropriately.

Supported call typeMinimum SDK version
Group call (conference)PlanetKit 3.6

Overview

There are four methods to control volume during a group call.

Volume control steps

The four methods are applied in sequential order, and the control applied at an earlier stage influences the control applied at subsequent stages.

1. Peer volume control

Applications can control volume in peer units belonging to a specific subgroup.

2. Subgroup silence setting

Applications can silence all audio of a specific subgroup.

3. Auto volume control to listen to focused audio

PlanetKit allows applications to create a focus list and listen to focused audio. PlanetKit decreases the audio volume of subgroups that are not on the focus list when a participant in the focused subgroup speaks. Volume reduction is not performed unless someone in the focused subgroup is speaking.

4. Mixed audio silence setting

Applications can silence all audio.

How to use volume control methods

This sections describes how to control volume for each method.

Peer volume control

To control the audio volume of a peer belonging to a specific subgroup, use SetPeerAudioVolumeLevelSetting(), which accepts the following parameters:

ParameterDescription
pPeerIdTarget peer's ID
bSetForAllSubgroupsIf true, the peer volume will be changed in all subgroups that the target peer is subscribing to.
szSubgroupNameName of the subgroup to apply the volume
unTalkerVolumeAudio volume level in the range from 0 to 110.
0 is muted, 100 is original, and 110 is the loudest.

Subgroup silence setting

To silence or unsilence all audio of a specific subgroup, use SubgroupManager::SilencePeersAudio(), which accepts the following parameters:

ParameterDescription
szSubgroupNameName of the target subgroup
bSilenceWhether to silence or unsilence the audio

Auto volume control to listen to focused audio

To enable auto volume control of focused subgroups, use SetPeersAudioAutoVolumeControl(), which accepts the following parameters:

ParameterDescription
arrSubgroupNamesArray of subgroup names to enable auto volume

To disable auto volume control of the focused subgroups, use ClearPeersAudioAutoVolumeControl().

Mixed audio silence setting

To silence all audio, use PlanetKitConference::SilencePeersAudio(), which takes the following parameters:

ParameterDescription
bSilenceWhether to silence or unsilence the audio

Subgroup tag and auto volume control

The SetTagMyAudioOfMainRoom() method tags audio routed to the main room as a subgroup. The auto volume controller in PlanetKit assumes the tagged audio is from the subgroup.

The volume of the tagged audio can be decreased when someone in the focused subgroup is speaking and if the tagged subgroup is not on the focus list. On the other hand, the volume of the other audios can be decreased when someone in the focused subgroup is speaking and if the tagged audio belongs to the focus list.

APIs related to volume control are as follows.