diff --git a/DS4Windows/DS4Library/DS4Audio.cs b/DS4Windows/DS4Library/DS4Audio.cs index b41ffb2..b256870 100644 --- a/DS4Windows/DS4Library/DS4Audio.cs +++ b/DS4Windows/DS4Library/DS4Audio.cs @@ -25,6 +25,16 @@ namespace DS4Windows.DS4Library } } + public uint getVolume() + { + float pfLevel = 0; + + if (endpointVolume != null) + endpointVolume.GetMasterVolumeLevelScalar(out pfLevel); + + return Convert.ToUInt32(pfLevel * 100); + } + public DS4Audio(DataFlow audioFlags = DataFlow.Render) { var audioEnumerator = new MMDeviceEnumeratorComObject() as IMMDeviceEnumerator; diff --git a/DS4Windows/DS4Library/DS4Device.cs b/DS4Windows/DS4Library/DS4Device.cs index 98479c2..e076a4b 100644 --- a/DS4Windows/DS4Library/DS4Device.cs +++ b/DS4Windows/DS4Library/DS4Device.cs @@ -803,8 +803,8 @@ namespace DS4Windows outputReportBuffer[8] = LightBarColor.blue; //blue outputReportBuffer[9] = ledFlashOn; //flash on duration outputReportBuffer[10] = ledFlashOff; //flash off duration - outputReportBuffer[19] = outputReportBuffer[20] = Convert.ToByte(audio.Volume); - outputReportBuffer[21] = Convert.ToByte(micAudio.Volume); + outputReportBuffer[19] = outputReportBuffer[20] = Convert.ToByte(audio.getVolume()); + outputReportBuffer[21] = Convert.ToByte(micAudio.getVolume()); } bool quitOutputThread = false;