bsl.StreamRecorder¶
- class bsl.StreamRecorder(record_dir=None, fname=None, stream_name=None, fif_subdir=True, *, verbose=False)[source]¶
Class for recording the signals coming from LSL streams.
- Parameters:
- record_dir
None
| path-like Path to the directory where data will be saved. If the directory does not exist, it is created. If
None
, the current working directory is used.- fname
None
|str
File name stem used to create the files. The StreamRecorder creates 2 files plus an optional third if a software trigger was used, respecting the following naming:
PCL: '{fname}-[stream_name]-raw.pcl' FIF: '{fname}-[stream_name]-raw.fif' (optional) SOFTWARE trigger events: '{fname}-eve.txt'
- stream_name
list
|str
|None
Servers’ name or list of servers’ name to connect to. If
None
, connects to all the available streams.- fif_subdir
bool
If
True
, the.pcl
files are converted to.fif
in a subdirectory'fif': record_dir/fif/...
instead ofrecord_dir
.- verbose
bool
If
True
, a timer showing since when the recorder started is displayed every seconds.
- record_dir
Attributes
Path to the event file for SoftwareTrigger.
If
True
, the.pcl
files are converted to.fif
in a subdirectory.File name stem used to create the files.
Launched process.
Path to the directory where data will be saved.
Recording state of the recorder.
Servers' name or list of servers' name to connect to.
If
True
, a timer showing since when the recorder started is displayed.Methods
- start(blocking=True)[source]¶
Start the recording in a new process.
- Parameters:
- blocking
bool
If
True
, waits for the child process to start recording data.
- blocking
- property fname¶
File name stem used to create the files.
The StreamRecorder creates 2 files plus an optional third if a software trigger was used, respecting the following naming:
PCL: '{fname}-[stream_name]-raw.pcl' FIF: '{fname}-[stream_name]-raw.fif' (optional) SOFTWARE trigger events: '{fname}-eve.txt'
- Type:
Examples using bsl.StreamRecorder
¶
StreamPlayer: simulate an LSL stream
StreamRecorder: resting-state recording
StreamReceiver: real-time buffer filtered with a causal filter
StreamReceiver: real-time alpha band power