private AudioHelper() { _isStartUp = true; GlobalEventAggregator.Instance.AddListener <SleepStateEventArgs>(SleepStateListner); //_quitPolling = false; _deviceEnumerator = new MMDeviceEnumerator(); _lastPeakValues = new PeakValues(); SetBitrate((AudioBitrate)Settings.Default.Bitrate); SetChannel((AudioChannel)Settings.Default.Channel); _currentDevice = GetDefaultDevice(); DeviceId = _currentDevice.DeviceID; DeviceName = _currentDevice.FriendlyName; _isStartUp = false; }
private AudioHelper() { _isStartUp = true; GlobalEventAggregator.Instance.AddListener <SleepStateEventArgs>(SleepStateListner); _deviceEnumerator = new MMDeviceEnumerator(); _deviceEnumerator.DeviceAdded += DeviceAdded; _deviceEnumerator.DeviceRemoved += DeviceRemoved; _deviceEnumerator.DeviceStateChanged += DeviceStateChanged; _deviceEnumerator.DevicePropertyChanged += DevicePropertyChanged; _lastPeakValues = new PeakValues(); SetBitrate((AudioBitrate)Settings.Default.Bitrate); SetChannel((AudioChannel)Settings.Default.Channel); _currentDevice = GetDefaultDevice(); Device = new AudioEndPoint(_currentDevice.FriendlyName, _currentDevice.DeviceID, GetDeviceFormat(_currentDevice).Channels, _currentDevice.DeviceState != DeviceState.Active, (int?)((_currentDevice.GetJackDescriptions()?.FirstOrDefault())?.Color)?.Value);; _isStartUp = false; }
public PeakValueEventArgs(PeakValues values) : this() { Values = values; }
internal void Update(PeakValues values) { Update(values.Muted, values.Master, values.Left, values.Right); }