private void UpdateItems() { if (_audioMeterInformation == null) { return; } CreateItems(); var values = _audioMeterInformation.GetChannelsPeakValues(); _items[0].Value = _audioMeterInformation.PeakValue; for (int i = 0; i < values.Length; i++) { _items[i + 1].Value = values[i]; } }
private void UpdateAudio(GeneralProfileDataModel dataModel) { // Update microphone, only bother with OverallPeak if (_defaultRecording != null) { dataModel.Audio.Recording.OverallPeak = _recordingInfo.PeakValue; } if (_defaultPlayback == null) { return; } // Update volume if a default device is found dataModel.Audio.Volume = AudioEndpointVolume.FromDevice(_defaultPlayback).GetMasterVolumeLevelScalar(); // Update speakers, only do overall, left and right for now // TODO: When adding list support lets do all channels var peakValues = _playbackInfo.GetChannelsPeakValues(); dataModel.Audio.Playback.OverallPeak = _playbackInfo.PeakValue; dataModel.Audio.Playback.LeftPeak = peakValues[0]; dataModel.Audio.Playback.RightPeak = peakValues[1]; }
public float[] GetChannelsPeakValues() { return(_audioMeterInformation.GetChannelsPeakValues()); }