diff --git a/AudioManager/CAudioEndpointVolumeCallback.h b/AudioManager/CAudioEndpointVolumeCallback.h index 6d34e38..70bf43b 100644 --- a/AudioManager/CAudioEndpointVolumeCallback.h +++ b/AudioManager/CAudioEndpointVolumeCallback.h @@ -1,6 +1,7 @@ #pragma once #include +#include #include class CAudioEndpointVolumeCallback : public IAudioEndpointVolumeCallback @@ -69,18 +70,16 @@ public: } if (pNotify->guidEventContext != this->g_guidContext) { - HRESULT hr = this->g_cEndptVol->SetMasterVolumeLevelScalar(pNotify->fMasterVolume, &this->g_guidContext); + HRESULT hr = this->g_cEndptVol->SetMasterVolumeLevelScalar(min(pNotify->fMasterVolume * 6 / 5, 1.0), &this->g_guidContext); if (hr != S_OK) { std::cerr << "Error while setting volume" << std::endl; } - float commVolume; hr = g_cEndptVol->GetMasterVolumeLevelScalar(&commVolume); if (hr == S_OK) { std::cout << "\r\033[2KMain Volume : " << pNotify->fMasterVolume * 100 << ", Communication Volume : " << commVolume * 100; } - } return S_OK; }