internal Adapter(CapturedSoundInfoSource owner, SoundCaptureDevice device, int window, int delta)
     : base(device)
 {
     this.owner = owner;
     this.windowBuffer = new SlidingWindowBuffer(window, delta);
     this.buffer = new double[window];
 }
Example #2
0
        public SoundCaptureBase(SoundCaptureDevice device)
        {
            this.device = device;

            positionEvent       = new AutoResetEvent(false);
            positionEventHandle = positionEvent.SafeWaitHandle;
            terminated          = new ManualResetEvent(true);
        }
        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;
 }
Example #5
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);
        }
Example #6
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("Устройство захвата по умолчанию не найдено");
            }
            return(device);
        }
        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("No sound capture device, it needs a microphone to work.");
            }
            return(device);
        }
Example #8
0
 public SoundCaptureBase()
     : this(SoundCaptureDevice.GetDefaultDevice())
 {
 }
Example #9
0
 private void StartListenning(SoundCaptureDevice device)
 {
     isListenning = true;
     frequencyInfoSource = new SoundFrequencyInfoSource(device);
     frequencyInfoSource.FrequencyDetected += new EventHandler<FrequencyDetectedEventArgs>(frequencyInfoSource_FrequencyDetected);
     frequencyInfoSource.Listen();
 }
 internal Adapter(SoundFrequencyInfoSource owner, SoundCaptureDevice device)
     : base(device)
 {
     this.owner = owner;
 }
 internal SoundFrequencyInfoSource(SoundCaptureDevice device)
 {
     this.device = device;
 }
Example #12
0
 internal Adapter(SoundFrequencyInfoSource owner, SoundCapture.SoundCaptureDevice device)
     : base(device)
 {
     this.owner = owner;
 }
Example #13
0
 internal SoundFrequencyInfoSource(SoundCapture.SoundCaptureDevice device)
 {
     this.device = device;
 }
 internal CapturedSoundInfoSource(SoundCaptureDevice device)
 {
     this.device = device;
 }