# Electron mac sdk can't auto join audio

**URL:** <https://devforum.zoom.us/t/electron-mac-sdk-cant-auto-join-audio/25804>\
**Category:** Electron\
**Created:** [July 31, 2020, 3:06am UTC](https://devforum.zoom.us/t/electron-mac-sdk-cant-auto-join-audio/25804 "2020-07-31T03:06:14Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![guan\_bj](https://avatars.discourse-cdn.com/v4/letter/g/e480ec/32.png) [@guan\_bj](https://devforum.zoom.us/u/guan_bj)\
**Post date:** [July 31, 2020, 3:06am UTC](https://devforum.zoom.us/t/electron-mac-sdk-cant-auto-join-audio/25804/1 "2020-07-31T03:06:14Z")

</div>

**Description**  
integrate sdk [v5.0.24433.0616] of electron. In mac platform, app can’t auto join audio event I set it as auto join.  
meetingConfig.MeetingConfig\_HideMeetingInfoOnMeetingUI({bEnable: false});  
this issue only happens in Mac platform.

same Mac computer start same meeting has get different result:  
[**mac native sdk**]

 ![Screen Shot 2020-07-30 at 10.57.28 PM](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/2X/b/b979335d0d3acbd335d1784df1bc3744d2e1846f.jpeg)

[**mac electron sdk**]

 ![Screen Shot 2020-07-30 at 10.58.30 PM](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/2X/3/32ca1806bbac1ffe933b0d2b21ac31aa9e342dc4.png)

another issue is virtual background feature does not support video in mac electron sdk.

---

<div class="post-metadata">

**Author:** ![DeveloperBot](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/developerbot/32/12632_2.png) [@DeveloperBot](https://devforum.zoom.us/u/DeveloperBot)\
**Post date:** [July 31, 2020, 3:07am UTC](https://devforum.zoom.us/t/electron-mac-sdk-cant-auto-join-audio/25804/2 "2020-07-31T03:07:01Z")

</div>

Hey @guan_bj

Thanks for posting on the Zoom Devforum! I am still learning, but I will try my best to help answer your question. 🙂

Checkout this related thread that may have the answer you are looking for:

> [@Mac SDK cannot share screen in electron。](https://devforum.zoom.us/t/-/4077):
>
> Description Mac SDK cannot share screen in electron。 Which version? zoom-macsdk-electron-4.3.47193.0321 To Reproduce(If applicable) Steps to reproduce the behavior: [QQ20190429-100345] Screenshots If applicable, add screenshots to help explain your problem. Additional context Add any other context about the problem here.![QQ20190429-100345|528x96] The onMeetingStatus function is not called bec…

If this thread did not help, please let us know by replying back here and someone from the Developer Relations team will get back to you shortly.

Thanks,  
DeveloperBot

---

<div class="post-metadata">

**Author:** ![carson.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/carson.zoom/32/785_2.png) [@carson.zoom](https://devforum.zoom.us/u/carson.zoom)\
**Post date:** [July 31, 2020, 5:32am UTC](https://devforum.zoom.us/t/electron-mac-sdk-cant-auto-join-audio/25804/3 "2020-07-31T05:32:42Z")

</div>

Hi @guan_bj,

Thanks for the post. Is the Zoom Mac client’s audio working on your device?

---

<div class="post-metadata">

**Author:** ![guan\_bj](https://avatars.discourse-cdn.com/v4/letter/g/e480ec/32.png) [@guan\_bj](https://devforum.zoom.us/u/guan_bj)\
**Post date:** [July 31, 2020, 11:22am UTC](https://devforum.zoom.us/t/electron-mac-sdk-cant-auto-join-audio/25804/4 "2020-07-31T11:22:11Z")

</div>

@carson.zoom My mac computer’s audio works well, since I join with Mac native code it join audio automatically(as the first picture). In fact it works with pre-version sdk 4.6.21666.0428

---

<div class="post-metadata">

**Author:** ![carson.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/carson.zoom/32/785_2.png) [@carson.zoom](https://devforum.zoom.us/u/carson.zoom)\
**Post date:** [August 1, 2020, 4:03am UTC](https://devforum.zoom.us/t/electron-mac-sdk-cant-auto-join-audio/25804/5 "2020-08-01T04:03:34Z")

</div>

Thanks for confirming @guan_bj, this feature works well on my side so I’m wondering if you could provide an SDK log for us for further investigation?

Thanks!

---

<div class="post-metadata">

**Author:** ![guan\_bj](https://avatars.discourse-cdn.com/v4/letter/g/e480ec/32.png) [@guan\_bj](https://devforum.zoom.us/u/guan_bj)\
**Post date:** [August 1, 2020, 11:10am UTC](https://devforum.zoom.us/t/electron-mac-sdk-cant-auto-join-audio/25804/6 "2020-08-01T11:10:06Z")

</div>

@Carson_Chen I fix this issue. I report two bugs  
**1. mac can’t auto join audio in mac [mac/meeting\_service\_wrap\_core.mm]** from: v5.0.24433.0616

 ![image](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/2X/5/5665ebabb5e08a656428c2cd2192dc7b8872c118.jpeg)  
 ![image](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/2X/5/5db248dad9f34dffd5a1ee3b14171abccffcb594.jpeg)

**2. fail to customize language resource in windows** from: the first version  
Electron sdk需要修改的地方

1. zoom\_native\_sdk\_wrap\_core.cpp 里的std::string wsTOs(const ZoomSTRING& s)函数  
//保存资源文件的全路径变量  
std::string g\_langPath = “”;  
/\*

这个函数原始代码有bug，会造成资源路径被转换后变为错的，导致语言资源文件加载失败

\*/

std::string wsTOs(const ZoomSTRING& s)

{

int iLength = WideCharToMultiByte(CP\_ACP, 0, s.c\_str(), -1, NULL, 0, NULL, NULL);

char \*pDest = new char[iLength + 1];

pDest[iLength] = ‘\0’;

WideCharToMultiByte(CP\_ACP, 0, s.c\_str(), -1, pDest, iLength, NULL, NULL);

std::string result(pDest);

return result;

}  
ZNSDKError ZNativeSDKWrap::InitSDK(ZNInitParam& initParam)  
{  
ZOOM\_SDK\_NAMESPACE::InitParam param;  
param.emLanguageID = Map2SDKDefine(initParam.langid);  
param.strWebDomain = initParam.domain.c\_str();  
param.enableLogByDefault = initParam.enable\_log;  
param.strSupportUrl = initParam.strSupportUrl.c\_str();  
param.obConfigOpts.customizedLang.langName = wsTOs(initParam.obConfigOpts.customizedLang.langName).c\_str();  
/\*  
\* 因为wsTOs函数返回的是栈上的临时变量，必须先拷贝到全局变量里，否则后面传给sdk.dll时，栈已经被回收了造成语言文件加载失败。  
\*/  
g\_langPath = wsTOs(initParam.obConfigOpts.customizedLang.langInfo).c\_str();  
param.obConfigOpts.customizedLang.langInfo = g\_langPath.c\_str();  
param.locale = Map2SDKDefine(initParam.locale);  
param.uiLogFileSize = initParam.logFileSize;

```
HMODULE hRes = NULL;
param.uiWindowIconSmallID = IDI_SDK_ICON;
param.uiWindowIconBigID = IDI_SDK_BIG_ICON;
GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, (LPCSTR)DummyFunc, &hRes);
param.hResInstance = hRes;
FreeLibrary(hRes);

ZNSDKError err = Map2WrapDefine(ZOOM_SDK_NAMESPACE::CSDKWrap::GetInst().InitSDK(
	initParam.path.size() > 0 ? initParam.path.c_str() : NULL, param));
if (ZNSDKERR_SUCCESS == err)
{
	_z_auth_service_wrap.Init();
}
return err;

```

}

1. sdk\_loader.cpp 里

ZOOM\_SDK\_NAMESPACE::SDKError CSDKImpl::InitSDK(ZOOM\_SDK\_NAMESPACE::InitParam& initParam)

{

ZOOM\_SDK\_NAMESPACE::SDKError ret(ZOOM\_SDK\_NAMESPACE::SDKERR\_UNINITIALIZE);

if (m\_fnInitSDK)

{

```
  //设置语言包

```

if(initParam.obConfigOpts.customizedLang.langInfo != NULL && strlen(initParam.obConfigOpts.customizedLang.langInfo) \> 0)

```
  {

     initParam.obConfigOpts.customizedLang.langType = (ZOOM_SDK_NAMESPACE::CustomizedLanguageType)1;

  }

  ret = m_fnInitSDK(initParam);

```

}

return ret;

}

---

<div class="post-metadata">

**Author:** ![carson.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/carson.zoom/32/785_2.png) [@carson.zoom](https://devforum.zoom.us/u/carson.zoom)\
**Post date:** [August 4, 2020, 5:09am UTC](https://devforum.zoom.us/t/electron-mac-sdk-cant-auto-join-audio/25804/7 "2020-08-04T05:09:47Z")

</div>

Hi @guan_bj,

Thanks for the reply and the detailed info. Glad to hear that you have found the solution and I will forward this to the engineering team to further investigate and fix them.

Thanks!
