How to use the pylsl.stream_info function in pylsl

To help you get started, we’ve selected a few pylsl examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sccn / lsl_archived / Apps / EyeLink / eyelink.py View on Github external
'''
Created on Jul 10, 2012

@author: SCCN
'''

from pylink import *
import pylsl,socket, time

if __name__ == '__main__':

    outlet = None 
    try:
        info = pylsl.stream_info("EyeLink","Gaze",9,100,pylsl.cf_float32,"eyelink-" + socket.gethostname());
        outlet = pylsl.stream_outlet(info)
        print "Established LSL outlet."
    except:
        print "Could not create LSL outlet."
    

    
    while True:
        try:
            print "Trying to connect to EyeLink tracker..."
            try:
                tracker = EyeLink("255.255.255.255")
                print "Established a passive connection with the eye tracker."
            except:
                tracker = EyeLink("100.1.1.1")
                print "Established a primary connection with the eye tracker."
github ozancaglayan / python-emotiv / lsl / lsl-pyemotiv.py View on Github external
import pylsl
import time

try:
    from emotiv import epoc
except ImportError:
    sys.path.insert(0, "..")
    from emotiv import epoc

if __name__ == '__main__':

    headset = epoc.EPOC()
    print "Found headset with serial number: ", headset.serial_number

    info = pylsl.stream_info('Emotiv EEG', 'EEG', len(headset.channel_mask),
                             headset.sampling_rate,
                             pylsl.cf_int16,
                             str(headset.serial_number))

    info_desc = info.desc()
    info_desc.append_child_value("manufacturer", "Emotiv")
    channels = info_desc.append_child("channels")

    for ch in headset.channel_mask:
        channels.append_child("channel").append_child_value("label", ch).append_child_value("unit","microvolts").append_child_value("type","EEG")

    # Outgoing buffer size = 360 seconds, transmission chunk size = 32 samples
    outlet = pylsl.stream_outlet(info, 1, 32)

    while True:
        try: