public WasapiCaptureViewModel()
 {
     synchronizationContext = SynchronizationContext.Current;
     var enumerator = new MMDeviceEnumerator();
     CaptureDevices = enumerator.EnumerateAudioEndPoints(DataFlow.Capture, DeviceState.Active).ToArray();
     var defaultDevice = enumerator.GetDefaultAudioEndpoint(DataFlow.Capture, Role.Console);
     SelectedDevice = CaptureDevices.FirstOrDefault(c => c.ID == defaultDevice.ID);
     RecordCommand = new DelegateCommand(Record);
     StopCommand = new DelegateCommand(Stop) { IsEnabled = false };
     RecordingsViewModel = new RecordingsViewModel();
 }
Beispiel #2
0
        public WasapiCaptureViewModel()
        {
            synchronizationContext = SynchronizationContext.Current;
            var enumerator = new MMDeviceEnumerator();

            CaptureDevices = enumerator.EnumerateAudioEndPoints(DataFlow.Capture, DeviceState.Active).ToArray();
            var defaultDevice = enumerator.GetDefaultAudioEndpoint(DataFlow.Capture, Role.Console);

            SelectedDevice = CaptureDevices.FirstOrDefault(c => c.ID == defaultDevice.ID);
            RecordCommand  = new DelegateCommand(Record);
            StopCommand    = new DelegateCommand(Stop)
            {
                IsEnabled = false
            };
            RecordingsViewModel = new RecordingsViewModel();
        }