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 type | Minimum SDK version |
---|---|
Group call (conference) | PlanetKit 3.6 |
Overview
There are four methods to control volume during a group call.
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 setPeerVolumeLevelSetting()
, which accepts the following parameters:
Parameter | Description |
---|---|
volumeLevel | Audio volume level in the range from 0 to 110. 0 is muted, 100 is original, and 110 is the loudest. |
peerId | Target peer's ID |
subgroupName | Name of the subgroup to apply the volume |
allSubgroupsPeerSubscribed | If true , the peer volume will be changed in all subgroups that the target peer is subscribing to. |
Subgroup silence setting
To silence or unsilence all audio of a specific subgroup, use silencePeersAudio()
of PlanetKitSubgroupManager
, which accepts the following parameters:
Parameter | Description |
---|---|
subgroupName | Name of the target subgroup |
silenced | Whether 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:
Parameter | Description |
---|---|
focusSubgroupNames | Array of subgroup names to enable auto volume |
focusMainRoom | If true , auto volume for the main room is enabled. |
To disable auto volume control of the focused subgroups, use clearPeersAudioAutoVolumeControl()
.
Mixed audio silence setting
To silence all audio, use silencePeersAudio()
of PlanetKitConference
, which takes the following parameters:
Parameter | Description |
---|---|
silent | Whether 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.
Related API
APIs related to volume control are as follows.
-
setPeerVolumeLevelSetting()
ofPlanetKitSubgroupManager
iOS, macOS -
silencePeersAudio()
ofPlanetKitSubgroupManager
iOS, macOS -
setPeersAudioAutoVolumeControl()
ofPlanetKitSubgroupManager
iOS, macOS -
clearPeersAudioAutoVolumeControl()
ofPlanetKitSubgroupManager
iOS, macOS -
silencePeersAudio()
ofPlanetKitConference
iOS, macOS -
setTagMyAudioOfMainRoom()
ofPlanetKitSubgroupManager
iOS, macOS