public static void Main(string[] args)
        {
            // wait until an EEG stream shows up
            StreamInfo[] results = LSL.LSL.resolve_stream("type", "Markers");

            // open an inlet and print meta-data
            using StreamInlet inlet = new StreamInlet(results[0]);
            results.DisposeArray();
            Console.Write(inlet.info().as_xml());

            // read samples
            string[] sample = new string[1];
            while (!Console.KeyAvailable)
            {
                inlet.pull_sample(sample);
                Console.WriteLine(sample[0]);
            }
        }
        public static void Main(string[] args)
        {
            // wait until an EEG stream shows up
            StreamInfo[] results = LSL.LSL.resolve_stream("type", "EEG");

            // open an inlet and print some interesting info about the stream (meta-data, etc.)
            using StreamInlet inlet = new StreamInlet(results[0]);
            results.DisposeArray();
            System.Console.Write(inlet.info().as_xml());

            // read samples
            float[] sample = new float[8];
            while (!System.Console.KeyAvailable)
            {
                inlet.pull_sample(sample);
                foreach (float f in sample)
                {
                    System.Console.Write("\t{0}", f);
                }
                System.Console.WriteLine();
            }
        }
Beispiel #3
0
        public double[] pullData()
        {
            double[] data   = new double[StreamInfo.channel_count() + 1];
            double[] sample = new double[StreamInfo.channel_count()];

            double timestamp = streamInlet.pull_sample(sample);

            timestamp += streamInlet.time_correction();

            sample.CopyTo(data, 0);

            if (customts)
            {
                timestamp            += _mainWindow.stopwatch.ElapsedMilliseconds;
                data[data.Length - 1] = timestamp;
            }
            else
            {
                data[data.Length - 1] = timestamp;
            }

            return(data);
        }