# Audio You can control user audio for an ongoing session using methods provided by the Video SDK. Session hosts can manage their own audio and video as well the audio and video of other users in the session. ## Check if the user is connected to audio Before implementing audio controls, you must first check if the user is connected to audio by getting the user's `ZoomVideoSDKAudioType`. ```cpp // Get the user's audioStatus. ZoomVideoSDKAudioStatus audioStatus = pUserInfo->getAudioStatus(); // Get the user's audioType. ZoomVideoSDKAudioType audioType = audioStatus.audioType; ``` ## Connect to audio If the user is not already connected, you can connect to the audio through the `IZoomVideoSDKAudioHelper`. ```cpp if (audioType == ZoomVideoSDKAudioType_None) { // User's audio is not connected. // Get the IZoomVideoSDKAudioHelper to perform audio actions. IZoomVideoSDKAudioHelper* pAudioHelper = m_pVideoSDK->getAudioHelper(); if (pAudioHelper) { // Connect User's audio. pAudioHelper->startAudio(); } } else { // User is already connected to audio. } ``` ## Mute audio Once connected, you can mute a user's audio by calling `muteAudio`: ```cpp // Get the IZoomVideoSDKAudioHelper to perform audio actions. IZoomVideoSDKAudioHelper* pAudioHelper = m_pVideoSDK->getAudioHelper(); if (pAudioHelper) { // Mute user. pAudioHelper->muteAudio(pUser); } ``` ## Unmute audio Unmute a user's audio in a similar manner using `unmuteAudio`: ```cpp // Get the IZoomVideoSDKAudioHelper to perform audio actions. IZoomVideoSDKAudioHelper* pAudioHelper = m_pVideoSDK->getAudioHelper(); if (pAudioHelper) { // Unmute user. pAudioHelper->unMuteAudio(pUser); } ``` ## Disconnect from audio To disconnect completely from audio, use the `stopAudio`: ```cpp // Get the IZoomVideoSDKAudioHelper to perform audio actions. IZoomVideoSDKAudioHelper* pAudioHelper = m_pVideoSDK->getAudioHelper(); if (pAudioHelper) { // Disconnect User's audio. pAudioHelper->stopAudio(); } ``` ## Sound options By default, Zoom uses noise suppression and echo cancellation to improve the quality of the audio received by your microphone, but these audio filters can interfere with situations that require capturing the full range of audio. See [Configuring professional audio settings for Zoom Meetings](https://support.zoom.com/hc/en/article?id=zm_kb&sysparm_article=KB0059985) for details. Video SDK uses the same technology to improve audio quality, but also supports the ability to turn off these filters to capture the **original sound** of the microphone, for example, to support the use of a high-quality microphone with built-in audio filters or to capture the full audio range without noise suppression. _**Capturing the microphone's original sound disables the background noise suppression feature.**_ ### Original sound To enable original sound, set [`enableMicOriginalInput`](https://marketplacefront.zoom.us/sdk/custom/windows/class_i_zoom_video_s_d_k_audio_setting_helper.html#a35d9ff96bc7cd83b0e4c8f25571f2189) to `True` in the `IZoomVideoSDKAudioSettingHelper` class. The default setting is `False`. ```cpp IZoomVideoSDKAudioSettingHelper* audio_setting_helper = video_sdk_obj_->getAudioSettingHelper(); audio_setting_helper->enableMicOriginalInput(true); ``` To disable, set `enableMicOriginalInput` to `False`. ```cpp audio_setting_helper->enableMicOriginalInput(false); ``` ### Background noise suppression By default, Zoom Video SDK's standard optimized audio is used for processing your microphone audio. This includes some background noise suppression and is best for most situations, but the level of background noise suppression can be adjusted to suit your needs. Set the noise suppression level using [`setSuppressBackgroundNoiseLevel`](https://marketplacefront.zoom.us/sdk/custom/windows/class_i_zoom_video_s_d_k_audio_setting_helper.html#a3ac0d10a1096d35ac50772fdf6120b59) in the `IZoomVideoSDKAudioSettingHelper` class. ```cpp IZoomVideoSDKAudioSettingHelper* audio_setting_helper = video_sdk_obj_->getAudioSettingHelper(); audio_setting_helper->setSuppressBackgroundNoiseLevel(ZoomVideoSDKSuppressBackgroundNoiseLevel_High); ``` You can choose from [the following levels](https://marketplacefront.zoom.us/sdk/custom/windows/zoom__video__sdk__audio__setting__interface_8h.html#a18befba284d8f7216437d90898af0b2d): - `ZoomVideoSDKSuppressBackgroundNoiseLevel_Auto` (the default setting) - `ZoomVideoSDKSuppressBackgroundNoiseLevel_Low` - `ZoomVideoSDKSuppressBackgroundNoiseLevel_Medium` - `ZoomVideoSDKSuppressBackgroundNoiseLevel_High` ## Callbacks Be sure that you have [set up a delegate for callback events](/docs/video-sdk/windows/integrate/#callback-events) to receive audio callbacks. ### Get notified when a user's audio status has changed ```cpp void CExampleListener::onUserAudioStatusChanged(IZoomVideoSDKAudioHelper* pAudioHelper, IVideoSDKVector* userList) { CString strInfo; IZoomVideoSDKUser* pUser; int count = userList->GetCount(); for (int i = 0; i < count; i++) { pUser = userList->GetItem(i); strInfo.Format(_T("A user's audio status changed: name=%s, status=%s"), pUser->getUserName(), pUser->getAudioStatus()); } } ``` ### Get notified when a user's active audio changes ```cpp // onUserActiveAudioChanged is different from onUserAudioStatusChanged. onUserActiveAudioChanged is called when a given user's audio changes, while onUserAudioStatusChanged is called when the user's audio status changes. For example, if the user is unmuted and is using their device's microphone, this callback will be triggered whenever their microphone detects a noise. void CExampleListener::onUserActiveAudioChanged(IZoomVideoSDKAudioHelper* pAudioHelper, IVideoSDKVector* list) { CString strInfo; IZoomVideoSDKUser* pUser; int count = list->GetCount(); for (int i = 0; i < count; i++) { pUser = list->GetItem(i); strInfo.Format(_T("User's audio activity changed: name=%s"), pUser->getUserName()); } } ```