コード例 #1
0
        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;
        }
コード例 #2
0
        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;
        }
コード例 #3
0
 public PeakValueEventArgs(PeakValues values)
     : this()
 {
     Values = values;
 }
コード例 #4
0
 internal void Update(PeakValues values)
 {
     Update(values.Muted, values.Master, values.Left, values.Right);
 }