public SoundCaptureBase(SoundCaptureDevice device) { this.device = device; positionEvent = new AutoResetEvent(false); positionEventHandle = positionEvent.SafeWaitHandle; terminated = new ManualResetEvent(true); }
public static SoundCaptureDevice GetDefaultDevice() { CaptureDevicesCollection captureDevices = new CaptureDevicesCollection(); SoundCaptureDevice device = null; foreach (DeviceInformation captureDevice in captureDevices) { if (captureDevice.DriverGuid == Guid.Empty) { device = new SoundCaptureDevice(captureDevice.DriverGuid, captureDevice.Description); break; } } if (device == null) { throw new SoundCaptureException("Default capture device is not found"); } return(device); }
public SoundCaptureBase() : this(SoundCaptureDevice.GetDefaultDevice()) { }