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 EInitialMyAudioState enum defines the following values for the initial audio state:
PLNK_INITIAL_MY_AUDIO_STATE_UNMUTED: The microphone is activated and audio captured by the microphone is transmitted.PLNK_INITIAL_MY_AUDIO_STATE_MUTED: The microphone is not activated and audio is not transmitted.
Note
- The default value of the APIs described below is
PLNK_INITIAL_MY_AUDIO_STATE_UNMUTED. - If you set the initial audio state to
PLNK_INITIAL_MY_AUDIO_STATE_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
PLNK_INITIAL_MY_AUDIO_STATE_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()ofMakeCallParamwhen making a call. - Callee side: Set the
eInitialMyAudioStateparameter 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 ConferenceParam 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.