# Audio You can control user audio for an ongoing session using `IZoomVideoSDKAudioHelper`. Session hosts can manage their own audio as well the audio of other users in the session. ## Check if the user is connected to audio Before you can use audio controls, you must first check if the user is connected to audio. Use the `ZoomVideoSDKAudioStatus` and `ZoomVideoSDKAudioType` methods to do this. ```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, to mute a user's audio, call `muteAudio`. ```cpp // Get the IZoomVideoSDKAudioHelper to perform audio actions. IZoomVideoSDKAudioHelper* pAudioHelper = m_pVideoSDK->getAudioHelper(); if (pAudioHelper) { // Mute user. pAudioHelper->muteAudio(pUser); } ``` ## Unmute audio To unmute a user's audio, call `unmuteAudio`. ```cpp // Get the IZoomVideoSDKAudioHelper to perform audio actions. IZoomVideoSDKAudioHelper* pAudioHelper = m_pVideoSDK->getAudioHelper(); if (pAudioHelper) { // Unmute user. pAudioHelper->unMuteAudio(pUser); } ``` ## Disconnect audio To completely disconnect from audio, call `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/linux/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/linux/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/linux/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/linux/integrate/#callback-events) to receive audio callbacks. The `onUserAudioStatusChanged` callback is different from `onUserActiveAudioChanged`. - The SDK calls `onUserAudioStatusChanged` when the user's audio status changes. - The SDK calls `onUserActiveAudioChanged` when a given user's active audio changes. For example, if the user is unmuted and is using their device's microphone, the SDK triggers this callback whenever their microphone detects a noise. See the following examples for details. ### Audio status changed Get notified when a user's audio status has changed (for example, when a user goes unmutes). ```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()); } } ``` ### Active audio changed Get notified when a user's active audio changes (for example, when an unmuted user's microphone detects a noise). ```cpp // onUserActiveAudioChanged triggered when an unmuted user's 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()); } } ```