public NoiseDetectorViewModel(INoiseDetectorOptions options, IAudioHandler audio, IEventAggregator eventAggregator) { _noiseDetectorOptions = options; _audio = audio; _audio.AudioEventAvailable += OnAudioEventAvailable; _eventAggregator = eventAggregator; _eventAggregator.GetEvent <NoiseDetectorChangeEvent>().Subscribe(OnStopRequested); }
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(); }
public NAudioHandler(INoiseDetectorOptions options) { _noiseDetectionOptions = options; if (_noiseDetectionOptions.ListenOnStartup) { StartListen(); } _recordTimer = new Timer { AutoReset = true }; _recordTimer.Elapsed += RecordTimer_Elapsed; }