void Start()
        {
            var channelDefinitions = SetupChannels();

            dataRate = LSLUtils.GetSamplingRateFor(sampling);

            channelCount = channelDefinitions.Count;

            // initialize the array once
            currentSample = new float[channelCount];

            streamInfo = new liblsl.StreamInfo(StreamName, StreamType, channelCount, dataRate, liblsl.channel_format_t.cf_float32, unique_source_id);

            // it's not possible to create a XMLElement before and append it.
            liblsl.XMLElement chns = streamInfo.desc().append_child("channels");
            // so this workaround has been introduced.
            foreach (var def in channelDefinitions)
            {
                chns.append_child("channel")
                .append_child_value("label", def.label)
                .append_child_value("unit", def.unit)
                .append_child_value("type", def.type);
            }

            outlet = new liblsl.StreamOutlet(streamInfo);
        }
Пример #2
0
    // Use this for initialization
    void Start()
    {
        dataRate = LSLUtils.GetSamplingRateFor(sampling);

        streamInfo = new liblsl.StreamInfo(StreamName, StreamType, ChannelCount, dataRate, liblsl.channel_format_t.cf_int32, unique_source_id);

        outlet = new liblsl.StreamOutlet(streamInfo);
    }
Пример #3
0
        void Start()
        {
            // initialize the array once
            currentSample = new float[ChannelCount];

            dataRate = LSLUtils.GetSamplingRateFor(sampling);

            streamInfo = new liblsl.StreamInfo(StreamName, StreamType, ChannelCount, dataRate, liblsl.channel_format_t.cf_float32, unique_source_id);

            outlet = new liblsl.StreamOutlet(streamInfo);
        }