Exemplo n.º 1
0
        public MainForm()
        {
            InitializeComponent();

            // TODO: add coreProps.json file selection
            var corePropsPath = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + @"\SteelSeries\SteelSeries Engine 3\coreProps.json";

            using (StreamReader file = File.OpenText(corePropsPath)) {
                JsonSerializer serializer             = new JsonSerializer();
                Dictionary <string, string> coreProps = JsonConvert.DeserializeObject <Dictionary <string, string> >(file.ReadToEnd());
                sseUri = new Uri("http://" + coreProps["address"] + "/game_event");
            }

            binner = new FrequencyBinner(bins);

            fftResults = new float[fftSize];

            sampleAggregator = new SampleAggregator(fftSize);

            // TODO: add device selection
            waveIn = new WasapiLoopbackCapture();
            waveIn.RecordingStopped += (s, e) => {
                _recording = false;
            };
            waveIn.DataAvailable += OnDataAvailable;
        }
Exemplo n.º 2
0
        public MainForm()
        {
            InitializeComponent();

            // TODO: add coreProps.json file selection
            var corePropsPath = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + @"\SteelSeries\SteelSeries Engine 3\coreProps.json";
            using (StreamReader file = File.OpenText(corePropsPath)) {
                JsonSerializer serializer = new JsonSerializer();
                Dictionary<string, string> coreProps = JsonConvert.DeserializeObject<Dictionary<string, string>>(file.ReadToEnd());
                sseUri = new Uri("http://" + coreProps["address"] + "/game_event");
            }

            binner = new FrequencyBinner(bins);

            fftResults = new float[fftSize];

            sampleAggregator = new SampleAggregator(fftSize);
            
            // TODO: add device selection
            waveIn = new WasapiLoopbackCapture();
            waveIn.RecordingStopped += (s, e) => {
                _recording = false;
            };
            waveIn.DataAvailable += OnDataAvailable;
        }