Beispiel #1
0
 private static void FireAudioDeviceChanged(AudioDeviceChangedEventArgs e)
 {
     if (AudioDeviceChanged != null)
     {
         AudioDeviceChanged(e.Device, e);
     }
 }
 private void OnAudioDeviceChanged(object sender, AudioDeviceChangedEventArgs e)
 {
     if (e.DefaultPlayback != null)
     {
         _endPointVolume = AudioEndpointVolume.FromDevice(e.DefaultPlayback);
     }
 }
Beispiel #3
0
 public void OnAudioDeviceChanged(AudioDeviceChangedEventArgs e)
 {
     if (AudioDeviceChanged != null)
     {
         AudioDeviceChanged(e.Device, e);
     }
 }
Beispiel #4
0
 private void AudioDeviceManager_AudioDeviceChanged(object sender, AudioDeviceChangedEventArgs e)
 {
     if (e.Device.IsPlaybackDevice)
     {
         RefreshPlaybackDevices();
     }
     else if (e.Device.IsRecordingDevice)
     {
         RefreshRecordingDevices();
     }
 }
        private void AudioDeviceChanged(object sender, AudioDeviceChangedEventArgs e)
        {
            _defaultRecording = e.DefaultRecording;
            _defaultPlayback  = e.DefaultPlayback;

            if (_defaultRecording != null)
            {
                _recordingInfo = AudioMeterInformation.FromDevice(_defaultRecording);
            }
            if (_defaultPlayback != null)
            {
                _playbackInfo = AudioMeterInformation.FromDevice(_defaultPlayback);
            }
        }
Beispiel #6
0
        private void EnumeratorOnAudioDeviceChanged(object sender, AudioDeviceChangedEventArgs audioDeviceChangedEventArgs)
        {
            if (audioDeviceChangedEventArgs.Device.Id != Id)
            {
                return;
            }

            ComThread.Invoke(() =>
            {
                LoadProperties(_device);
            });

            switch (audioDeviceChangedEventArgs.EventType)
            {
            case AudioDeviceEventType.Volume:
            case AudioDeviceEventType.Level:
            case AudioDeviceEventType.StateChanged:
            case AudioDeviceEventType.PropertyChanged:
                OnPropertyChanged("DeviceType");
                OnPropertyChanged("InterfaceName");
                OnPropertyChanged("FullName");
                OnPropertyChanged("IconPath");
                OnPropertyChanged("Id");
                OnPropertyChanged("IsCaptureDevice");
                OnPropertyChanged("IsMuted");
                OnPropertyChanged("IsPlaybackDevice");
                OnPropertyChanged("Name");
                OnPropertyChanged("State");
                OnPropertyChanged("FullName");
                break;

            case AudioDeviceEventType.DefaultDevice:
                OnPropertyChanged("IsDefaultDevice");
                break;

            case AudioDeviceEventType.DefaultCommunicationsDevice:
                OnPropertyChanged("IsDefaultCommunicationsDevice");
                break;
            }
        }
Beispiel #7
0
        private void OnAudioDeviceChanged(object sender, AudioDeviceChangedEventArgs e)
        {
            if (_properties == null || _properties.Device != "Default")
            {
                return;
            }

            if (_properties.DeviceType == MmDeviceType.Input)
            {
                if (e.DefaultRecording != null)
                {
                    _audioCapture = _audioCaptureManager.GetAudioCapture(e.DefaultRecording, MmDeviceType.Input);
                }
            }
            else
            {
                if (e.DefaultPlayback != null)
                {
                    _audioCapture = _audioCaptureManager.GetAudioCapture(e.DefaultPlayback, MmDeviceType.Ouput);
                }
            }

            _lines = 0;
        }
 protected virtual void OnAudioDeviceChanged(AudioDeviceChangedEventArgs e)
 {
     AudioDeviceChanged?.Invoke(this, e);
 }
 private void RaiseAudioDeviceChanged(AudioDeviceChangedEventArgs e)
 {
     OnAudioDeviceChanged(this, e);
 }
 private static void FireAudioDeviceChanged(AudioDeviceChangedEventArgs e)
 {
     if (AudioDeviceChanged != null)
         AudioDeviceChanged(e.Device, e);
 }