예제 #1
0
        public SoundCaptureBase(SoundCaptureDevice device)
        {
            this.device = device;

            positionEvent       = new AutoResetEvent(false);
            positionEventHandle = positionEvent.SafeWaitHandle;
            terminated          = new ManualResetEvent(true);
        }
예제 #2
0
        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);
        }
예제 #3
0
 public SoundCaptureBase()
     : this(SoundCaptureDevice.GetDefaultDevice())
 {
 }