Skip to content

Tutorial 2: Getting started with LSL (multiple streams)

mgbleichner edited this page Sep 11, 2018 · 15 revisions

In this tutorial, you learn to record two streams simultaneously, one data stream (here Audio), and one marker stream (key presses)

For this tutorial you need

The LSL App can be downloaded from the ftp as .zip files.


  • Start LabRecorder.exe
  • Start AudioCaptureWin.exe
  • Start Keyboard.exe

Now we conduct a little experiment in which we record button presses and microphone input

  • Start a new recording in the LabRecorder: Click 'Start'

  • Repeat the following steps for all letters on the middle row of the keyboard (from ‘a’ to ‘l’, on a QWERTY keyboard)

    1. Press down the key on the keyboard
    2. Pronounce the letter
    3. Release the key (make sure that you release the key once you are finished pronouncing this letter).
  • Stop the recording

  • In MATLAB change to the directory of MATLAB Importer

    • Load the .xdf file you just recorded: data=load_xdf(‘C:\yourfilepath\’) (Or simply copy the path that is shown in the LabRecorder 'Storage Location')
    • The structure now contains two streams
    • Continuous signal of the audio stream (type 'audio')
    • Marker stream of the button presses (type 'marker')
    • Visualize the results (markers and audio)

The load_xdf function provides several advanced options for time synchronization, support for breaks in the data, as well as other defects (see help load_xdf).



For EEGlab users there is and xdf_import plugin.

  • Start EEG lab
  • You can load the data either from the gui or the command line
  • EEG=pop_loadxdf(filepath,’streamtype’, ‘Audio’)
  • Specify in this case that the stream has the type ‘Audio’
  • With the option ‘exclude_markerstreams’ you can select to exclude some marker streams if needed
  • You now can use the standard functionality of EEGLab such as data visualization or epoching