Exemple #1
0
 public NoiseDetectorViewModel(INoiseDetectorOptions options, IAudioHandler audio, IEventAggregator eventAggregator)
 {
     _noiseDetectorOptions = options;
     _audio = audio;
     _audio.AudioEventAvailable += OnAudioEventAvailable;
     _eventAggregator            = eventAggregator;
     _eventAggregator.GetEvent <NoiseDetectorChangeEvent>().Subscribe(OnStopRequested);
 }
Exemple #2
0
        public ConfigurationProvider(INoiseDetectorOptions noiseDetectorOptions, IPowerPlanOptions ppOptions)
        {
            // init with default values
            NoiseDetectorOptions = noiseDetectorOptions;
            PowerPlanOptions     = ppOptions;
            InitDefaults();

            // check for existing config
            _configFile = Path.Combine(_configPath, "NoiseDetectorConfig.json");
            Load();
        }
Exemple #3
0
 public NAudioHandler(INoiseDetectorOptions options)
 {
     _noiseDetectionOptions = options;
     if (_noiseDetectionOptions.ListenOnStartup)
     {
         StartListen();
     }
     _recordTimer = new Timer {
         AutoReset = true
     };
     _recordTimer.Elapsed += RecordTimer_Elapsed;
 }