bsl.StreamPlayer¶
- class bsl.StreamPlayer(stream_name, fif_file, repeat=inf, trigger_def=None, chunk_size=16, high_resolution=False)[source]¶
Class for playing a recorded file on LSL network in another process.
- Parameters:
- stream_name
str Stream’s server name, displayed on LSL network.
- fif_filefile-like
Path to the compatible raw
.fiffile to play.- repeat
int|float('inf') Number of times the stream player will loop on the FIF file before interrupting. Default
float('inf')can be passed to never interrupt streaming.- trigger_def
None| file-like |TriggerDef If not
None, a TriggerDef instance is used to log events with a descriptive string instead of their ID. If notNone, either a TriggerDef instance or the path to a valid.inifile passed to TriggerDef.- chunk_size
int Number of samples to send at once (usually
16-32is good enough).- high_resolution
bool If
True, it usesperf_counterinstead ofsleepfor higher time resolution. However, it uses more CPU.
- stream_name
Attributes
Number of samples to send at once (usually
16-32is good enough).Path to the compatible raw
.fiffile to play.If
True, it usesperf_counterinstead ofsleep.Launched streaming process.
Number of times the stream player will loop.
Streaming state of the player.
Stream's server name, displayed on LSL network.
Either
Noneor TriggerDef instance.Methods
start([blocking])Start streaming data on LSL network in a new process.
stop()Stop the streaming by terminating the process.
- start(blocking=True)[source]¶
Start streaming data on LSL network in a new process.
- Parameters:
- blocking
bool If
True, waits for the child process to start streaming data.
- blocking
- property high_resolution¶
If
True, it usesperf_counterinstead ofsleep.- Type:
- property repeat¶
Number of times the stream player will loop.
Default
float('inf')can be passed to never interrupt streaming.- Type:
int |
float('ìnf')
- property trigger_def¶
Either
Noneor TriggerDef instance.Used to convert event numbers into event strings.
- Type:
Examples using bsl.StreamPlayer¶
StreamReceiver: real-time buffer filtered with a causal filter