labstreaminglayer / pylsl

Python bindings (pylsl) for liblsl
MIT License
142 stars 58 forks source link

What data type can we use for channel_format? #72

Closed anbara closed 12 months ago

anbara commented 1 year ago

Hello,

When I created a python script that stream a sensor data, I had a problem. I can't find out the data type we can use while I looked forward to any documents. (I think the information of data type we can should be written on liblsl doc)

Finally, I got this information from pylsl/pylsl.py. Maybe we can use undefined, float32, double64, string, int32, int16, int8, and int64, right?

I want someone add to the data type info to the document web site.

Thank you :)

cboulay commented 1 year ago

Here are the formats for liblsl: https://github.com/sccn/liblsl/blob/45017108067125c223011f994536bf50914afbc1/include/lsl_cpp.h#L57-L82

And they are available on the website: https://labstreaminglayer.readthedocs.io/projects/liblsl/ref/enums.html#_CPPv420lsl_channel_format_t

For pylsl, there is no documentation website. You have to look at the examples and source. I've updated the SendDataAdvanced.py example with some additional details: https://github.com/labstreaminglayer/pylsl/blob/13853cf17e7e3622c3984356308402956f310d40/pylsl/examples/SendDataAdvanced.py#L30-L34

anbara commented 12 months ago

Thank you for adding the details on example code! I hope the new LSL users will not have the same problems as me.