Advanced features

Beyond the core audio controls, the Video SDK for Windows offers several advanced audio features.

Select a microphone or speaker

To choose which capture and playback devices the SDK uses, enumerate the available devices with getMicList and getSpeakerList, then pass a device's ID and name to selectMic or selectSpeaker.

IZoomVideoSDKAudioHelper* pAudioHelper = m_pVideoSDK->getAudioHelper();
// Enumerate microphones.
IVideoSDKVector<IZoomVideoSDKMicDevice*>* pMicList = pAudioHelper->getMicList();
for (int i = 0; i < pMicList->GetCount(); i++)
{
    IZoomVideoSDKMicDevice* pMic = pMicList->GetItem(i);
    // Inspect pMic->getDeviceName() and pMic->getDeviceId() to find the device you want.
}
// Select a microphone by its ID and name.
pAudioHelper->selectMic(deviceId, deviceName);

Select a speaker the same way using getSpeakerList and selectSpeaker.

Monitor mic and speaker volume

The SDK reports the local microphone and speaker volume levels through the onMicSpeakerVolumeChanged callback. Use this to drive a volume meter in your UI or to detect when the mic gain has been pushed unusually low.

void CExampleListener::onMicSpeakerVolumeChanged(unsigned int micVolume, unsigned int speakerVolume)
{
    // Update your volume meters with micVolume and speakerVolume.
}

Adjust a user's local playback volume

You can control how loud each user sounds on the local device using setUserPlaybackVolume on the IZoomVideoSDKUser object. This only changes what the current user hears. It does not change the volume for any other participant in the session. Setting the volume to 0 silences that user on your device only.

The isShareAudio argument selects whether you are adjusting microphone audio (false) or shared audio (true, used when the user is sharing a screen with audio). Use canSetUserPlaybackVolume to check whether the SDK currently permits a volume change for that audio source. For example, the SDK returns false for a user who is not connected to audio.

// Lower a remote user's microphone audio on this device only.
if (pRemoteUser->canSetUserPlaybackVolume(false)) {
    pRemoteUser->setUserPlaybackVolume(5.0f, false);
}
// Read the current local playback volume.
float currentVolume = 0;
pRemoteUser->getUserPlaybackVolume(currentVolume, false);

Subscribe to raw audio data

For server-side processing, transcription, or custom audio pipelines, the SDK can deliver raw PCM audio. Call subscribe on the IZoomVideoSDKAudioHelper to begin receiving raw audio, and unSubscribe to stop. The mixed, per-user, and shared raw streams arrive through the onMixedAudioRawDataReceived, onOneWayAudioRawDataReceived, and onSharedAudioRawDataReceived callbacks.

m_pVideoSDK->getAudioHelper()->subscribe();

For the full raw-data integration pattern, see Receive raw data.