# Auto Connect To Audio

**URL:** <https://devforum.zoom.us/t/auto-connect-to-audio/53191>\
**Category:** Android\
**Created:** [June 26, 2021, 7:25am UTC](https://devforum.zoom.us/t/auto-connect-to-audio/53191 "2021-06-26T07:25:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![soumoghosh37](https://avatars.discourse-cdn.com/v4/letter/s/b2d939/32.png) [@soumoghosh37](https://devforum.zoom.us/u/soumoghosh37)\
**Post date:** [June 26, 2021, 7:25am UTC](https://devforum.zoom.us/t/auto-connect-to-audio/53191/1 "2021-06-26T07:25:28Z")

</div>

**Description**  
I want the audio to be automatically connected over VoIP when the user joins the meeting, but I’m not able to.

**Code:**

```auto
InMeetingAudioController controller;
controller = ZoomSDK.getInstance().getInMeetingService().getInMeetingAudioController();
if (!controller.isAudioConnected()){
     controller.connectAudioWithVoIP();
}

```

This is inside the `joinMeeting()` method which is called when the user clicks on “Join” button. Everything is working normally but the audio is not being connected automatically and I’m getting the option to connect it.

**Which Android Client SDK version?**  
v5.5.1.1319

**To Reproduce**  
Put this code inside the `joinMeeting()` and hopefully it will reproduce.

**Smartphone:**

- Device: Pixel 4 XL (Android emulator)
- OS: Android 11

**Additional context**  
Probably it has an easy solution, but I’m not much experienced. So, sorry 😕

---

<div class="post-metadata">

**Author:** ![jon.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jon.zoom/32/13495_2.png) [@jon.zoom](https://devforum.zoom.us/u/jon.zoom)\
**Post date:** [June 28, 2021, 4:31pm UTC](https://devforum.zoom.us/t/auto-connect-to-audio/53191/2 "2021-06-28T16:31:20Z")

</div>

Hi @soumoghosh37, thanks for the post.

If you try to perform in-meeting functionality immediately after attempting to join a meeting, it will fail since joining a meeting is an async operation. Please try calling this after receiving the [`onMeetingStatusChanged`](https://marketplacefront.zoom.us/sdk/meeting/android/us/zoom/sdk/MeetingServiceListener.html#onMeetingStatusChanged-us.zoom.sdk.MeetingStatus-int-int-) callback with a status of `MeetingStatus.MEETING_STATUS_INMEETING`.

Thanks!

---

<div class="post-metadata">

**Author:** ![soumoghosh37](https://avatars.discourse-cdn.com/v4/letter/s/b2d939/32.png) [@soumoghosh37](https://devforum.zoom.us/u/soumoghosh37)\
**Post date:** [July 17, 2021, 11:56am UTC](https://devforum.zoom.us/t/auto-connect-to-audio/53191/4 "2021-07-17T11:56:10Z")

</div>

Hi @jon.zoom

Thanks for helping! I was able to solve from your reply and from [this link](https://devforum.zoom.us/t/enabling-the-audio-before-joining-a-meeting/4987/4)!

**My code:**

```auto
        ZoomSDK.getInstance().getMeetingSettingsHelper().setAutoConnectVoIPWhenJoinMeeting(true);
        MeetingStatus status;
        status = ZoomSDK.getInstance().getMeetingService().getMeetingStatus();
        if (status == MeetingStatus.MEETING_STATUS_INMEETING){
            InMeetingAudioController controller;
            controller = ZoomSDK.getInstance().getInMeetingService().getInMeetingAudioController();
            if (!controller.isAudioConnected()){
                controller.connectAudioWithVoIP();
            }
        }

```

---

<div class="post-metadata">

**Author:** ![jon.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jon.zoom/32/13495_2.png) [@jon.zoom](https://devforum.zoom.us/u/jon.zoom)\
**Post date:** [July 19, 2021, 5:43pm UTC](https://devforum.zoom.us/t/auto-connect-to-audio/53191/5 "2021-07-19T17:43:42Z")

</div>

Glad you were able to resolve this!

Please don’t hesitate to reach back out with any additional questions. 🙂

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [August 19, 2021, 3:44am UTC](https://devforum.zoom.us/t/auto-connect-to-audio/53191/6 "2021-08-19T03:44:40Z")

</div>

Closed on August 19, 2021, 3:44am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
