# Manage in-meeting audio settings

<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

> The code on this page works with either the **default UI** or the **custom UI**.

Let individual users manage their own various audio settings and control their in-meeting audio state. Additionally, meeting hosts can manage settings for other users and for the meeting as a whole.

Most of the functionality is done through `InMeetingAudioController`, which can be accessed after the participant joins the meeting.

```kotlin
val audioController = ZoomSDK.getInstance().inMeetingService.inMeetingAudioController
```

```java
InMeetingAudioController audioController = ZoomSDK.getInstance().getInMeetingService().getInMeetingAudioController();
```

## Connect to meeting audio

After joining a meeting, the SDK instance may not be automatically connected to the meeting audio. To send or receive audio in the meeting, the SDK must connect to the audio channel.

```kotlin
if (!audioController.isAudioConnected) {
    audioController.connectAudioWithVoIP()
}
```

```java
if (!audioController.isAudioConnected) {
    audioController.connectAudioWithVoIP();
}
```

Once connected, the SDK can also disconnect from the audio channel. After disconnecting from audio, the SDK will no longer be able to send or receive audio until it reconnects.

```kotlin
if (audioController.isAudioConnected) {
    audioController.disconnectAudio()
}
```

```java
if (audioController.isAudioConnected) {
    audioController.disconnectAudio();
}
```

You can also check whether a specific user is connected to the audio channel by checking their audio type against `InMeetingSupportAudioType` constants.

-   `AUDIO_TYPE_VOIP` means that they're connected to the meeting audio channel.
-   `AUDIO_TYPE_TELEPHONY` means that they're using audio from their phone.
-   `AUDIO_TYPE_NONE` means that they are not connected.

```kotlin
user.audioStatus.audioType
```

```java
long type = user.getAudioStatus().getAudioType();
```

Depending on your audio connection, you may also choose to hide the audio dialog that appears after joining the meeting when users aren't connected to audio.

```kotlin
val meetingSettingsHelper = ZoomSDK.getInstance().meetingSettingsHelper
meetingSettingsHelper.disableAutoShowSelectJoinAudioDlgWhenJoinMeeting(true)
```

```java
MeetingSettingsHelper meetingSettingsHelper = ZoomSDK.getInstance().getMeetingSettingsHelper();
meetingSettingsHelper.disableAutoShowSelectJoinAudioDlgWhenJoinMeeting(true);
```

## Switch the audio output

To switch between the earpiece and speaker, check if the current device supports switching and then call `setLoudSpeakerStatus`.

```kotlin
if (audioController.canSwitchAudioOutput()) {
    audioController.loudSpeakerStatus = true
}
```

```java
if (audioController.canSwitchAudioOutput()) {
    audioController.setLoudSpeakerStatus(true);
}
```

## Mute or unmute audio

Mute the local user's audio with `muteMyAudio`. Additionally, if the meeting supports participants unmuting their own audio after it was muted by a host, do that by using the `muteMyAudio` method.

```kotlin
audioController.muteMyAudio(true)

if (audioController.canUnmuteMyAudio()) {
    audioController.muteMyAudio(false)
}
```

```java
audioController.muteMyAudio(true);

if (audioController.canUnmuteMyAudio()) {
    audioController.muteMyAudio(false);
}
```

If the current user is the host of a meeting, they can mute the other participants' audio.

For privacy reasons, the host cannot force another participant to unmute their audio. If the user is currently muted, this code will ask them to unmute their microphone.

```kotlin
audioController.muteAttendeeAudio(!user.audioStatus.isMuted, userId)
```

```java
audioController.muteAttendeeAudio(!user.getAudioStatus().isMuted(), userId);
```

The host can also simultaneously mute all attendees' audio.

```kotlin
audioController.muteAllAttendeeAudio(true)
```

```java
audioController.muteAllAttendeeAudio(true);
```

Update the meeting settings of the current meeting to mute by default upon joining the meeting. Unless the meeting explicitly prevents participants from unmuting themselves, any client instances can override this behavior

```kotlin
audioController.setMuteOnEntry(true)
```

```java
audioController.setMuteOnEntry(true);
```

## Stop incoming audio

The SDK supports stopping your device from receiving audio while staying connected to the audio channel. This allows your microphone to continue capturing audio and sending it to other meeting participants and will prevent your device from playing any audio produced by others.

```kotlin
audioController.stopIncomingAudio(!audioController.isIncomingAudioStopped)
```

```java
audioController.stopIncomingAudio(!audioController.isIncomingAudioStopped());
```

---
