Esempio n. 1
0
        public void Process()
        {
            if (_deviceNumber != _wasapiDeviceIndex || !_deviceInitialized)
            {
                UpdateDevice();
                _deviceNumber = BassWasapi.BASS_WASAPI_GetDevice();
            }

            if (!_deviceInitialized)
            {
                return;
            }

            GetBarData();
            float curVol = BassWasapi.BASS_WASAPI_GetDeviceLevel(_deviceNumber, -1) * VolumeScalar;

            _averagedVolume = Utility.Clamp(Utility.LinearInterpolate(_averagedVolume, curVol, 0.02f), 0f, 1f);
        }
        //Calculates Average Volume, Immediate Volume, and Bar Data from the currently active WASAPI device
        public void Process()
        {
            if (deviceNumber != WASAPIDeviceIndex || !deviceInitialized)
            {
                UpdateDevice();
                deviceNumber = BassWasapi.BASS_WASAPI_GetDevice();
            }
            if (!deviceInitialized)
            {
                return;
            }

            GetBarData();
            float CurVol = BassWasapi.BASS_WASAPI_GetDeviceLevel(deviceNumber, -1) * VolumeScalar;

            ImmediateVolume = CurVol;
            AveragedVolume  = Utility.Clamp(Utility.LinearInterpolate(AveragedVolume, CurVol, 0.02f), 0f, 1f);
        }