node-lsl
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

node-lsl

Lab stream layerl (LSL) bindings for node.js.

Build Status

Not all functions are currently available - pull requests are welcome (please also include a relevant test).

Usage example:

const lsl = require('node-lsl');
const numChannels = 3;
const info = lsl.create_streaminfo("Dummy", "EEG", numChannels, 100, lsl.channel_format_t.cft_float32, "Dummy EEG Device");
const desc = lsl.get_desc(info);
lsl.append_child_value(desc, "manufacturer", "Random Inc.");
const channels = lsl.append_child(desc, "channels");
for (let i = 0; i < numChannels; i++) {
    const channel = lsl.append_child(channels, "channel");
    lsl.append_child_value(channel, "label", "Channel " + i);
    lsl.append_child_value(channel, "unit", "microvolts");
    lsl.append_child_value(channel, "type", "EEG");
}
 
const outlet = lsl.create_outlet(info, 0, 360);
setInterval(function() {
    const samples = [];
    for (= 0; i < numChannels; i++) {
        samples.push(Math.random());
    }
    lsl.push_sample_ft(outlet, new lsl.FloatArray(samples), lsl.local_clock());
}, 10);

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.0
    3
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.0
    3

Package Sidebar

Install

npm i node-lsl

Weekly Downloads

3

Version

0.1.0

License

MIT

Last publish

Collaborators

  • urish