How to use the muse-js.zipSamples function in muse-js

To help you get started, we’ve selected a few muse-js examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github NeuroJS / angular-muse / src / app / app.component.ts View on Github external
async connect() {
    this.connecting = true;
    this.snackBar.dismiss();
    try {
      await this.muse.connect();
      this.controlResponses = this.muse.controlResponses;
      await this.muse.start();
      this.data = zipSamples(this.muse.eegReadings)
        .takeUntil(this.destroy)
        .do(() => this.cd.detectChanges());
      this.batteryLevel = this.muse.telemetryData
        .takeUntil(this.destroy)
        .map(t => t.batteryLevel);
      this.muse.accelerometerData
        .takeUntil(this.destroy)
        .map(reading => reading.samples[reading.samples.length - 1])
        .subscribe(this.accelerometer);
    } catch (err) {
      this.snackBar.open('Connection failed: ' + err.toString(), 'Dismiss');
    } finally {
      this.connecting = false;
    }
  }
github makebrainwaves / BrainWaves / app / utils / eeg / muse.js View on Github external
export const createRawMuseObservable = async () => {
  await client.start();
  const eegStream = await client.eegReadings;
  const markers = await client.eventMarkers.pipe(startWith({ timestamp: 0 }));
  return from(zipSamples(eegStream)).pipe(
    filter(sample => !sample.data.includes(NaN)),
    withLatestFrom(markers, synchronizeTimestamp),
    share()
  );
};

muse-js

Muse 2016 EEG Headset JavaScript Library

MIT
Latest version published 3 years ago

Package Health Score

49 / 100
Full package analysis

Similar packages