Skip to content

Potential ReadMe Error in LslStreamOutlet Example #5

Open
@nolanrbrady

Description

@nolanrbrady

This could be a misunderstanding on my part in terms of the intention of the code, but in the LslStreamOutlet example, I think there should be an await in front of the instance variable generation like this:

import { LslStreamOutlet } from '@neurodevs/node-lsl'

// await added here makes the example code work
const instance = await LslStreamOutlet.Create({
    name: 'Muse S (2nd gen)',
    type: 'EEG',
    channelNames: ['TP9', 'AF7', 'AF8', 'TP10', 'AUX'],
    sampleRate: 256,
    channelFormat: 'float32',
    sourceId: 'muse-s-eeg',
    manufacturer: 'Interaxon Inc.',
    unit: 'microvolt',
    chunkSize: 12,
    maxBuffered: 360,
})

// Must be in async function
await instance.pushSample(...)

I kept getting the error pushSample is not a function, but then I realized that the instance variable had never been fully initialized. It's minor and very possibly just my own issue, but it may save someone a bit of time in the future. All in all, thank you so much for making a JS LSL package. It's massively helpful!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions