Initial audio state
You can set the initial audio state of the local user, which is applied when starting a 1-to-1 call or joining a group call.
| Supported call type | Minimum SDK version |
|---|---|
| 1-to-1 call, group call (conference) | PlanetKit 7.1 |
Overview
The PlanetKitInitialMyAudioState enum defines the following values for the initial audio state:
UNMUTED: The microphone is activated and audio captured by the microphone is transmitted.MUTED: The microphone is not activated and audio is not transmitted.
Note
- The default value of the APIs described below is
UNMUTED. - If you set the initial audio state to
MUTED, the local user's microphone is not activated at the start of the call and audio is not transmitted to peers. To transmit audio, you must callmuteMyAudio()withfalseafterward. - Starting with
MUTEDprevents the microphone indicator from appearing at call start, since the microphone device is not activated until unmuted.
Setting the initial audio state
Depending on the call type, the API used to set the initial audio state is as follows.
1-to-1 call
- Caller side: Use
setInitialMyAudioState()ofPlanetKitMakeCallParam.Builderwhen making a call. - Callee side: Set the
initialMyAudioStateparameter ofacceptCall()when accepting a call.
For a code example of setting the initial audio state in 1-to-1 calls, see 1-to-1 audio call and 1-to-1 video call.
Group call
Use setInitialMyAudioState() of PlanetKitConferenceParam.Builder when joining a group call.
For a code example of setting the initial audio state in group calls, see Group audio call and Group video call.
Related API
APIs related to initial audio state setting are as follows.