Skip to content

Commit

Permalink
fix(Volume): Fix volume calculation
Browse files Browse the repository at this point in the history
See #1096
  • Loading branch information
Belphemur committed Jan 22, 2023
1 parent 6b45a50 commit 9b692c8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions SoundSwitch.Common/Framework/Audio/Device/DeviceFullInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ public DeviceFullInfo(MMDevice device) : base(device)
if (device.State == DeviceState.Active)
{
var deviceAudioEndpointVolume = device.AudioEndpointVolume;
Volume = (int)(deviceAudioEndpointVolume.MasterVolumeLevelScalar * 100);
deviceAudioEndpointVolume.OnVolumeNotification += data => Volume = (int)data.MasterVolume * 100;
Volume = (int)Math.Round(deviceAudioEndpointVolume.MasterVolumeLevelScalar * 100);
deviceAudioEndpointVolume.OnVolumeNotification += data => Volume = (int)Math.Round(data.MasterVolume * 100F);
}
}
catch
Expand Down

0 comments on commit 9b692c8

Please sign in to comment.