How to use the muse-js.MuseClient 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 makebrainwaves / BrainWaves / app / utils / eeg / muse.js View on Github external
import { from } from 'rxjs';
import { parseMuseSignalQuality } from './pipes';
import {
  MUSE_SAMPLING_RATE,
  MUSE_CHANNELS,
  PLOTTING_INTERVAL
} from '../../constants/constants';

const INTER_SAMPLE_INTERVAL = -(1 / 256) * 1000;

let bluetooth = {};
let client = {};
if (process.platform !== 'win32' || release().split('.')[0] >= 10) {
  // Just returns the client object from Muse JS
  bluetooth = require('bleat').webbluetooth;
  client = new MuseClient();
  client.enableAux = true;
}
// Gets an available Muse device
// TODO: test whether this will ever return multiple devices if available
export const getMuse = async () => {
  let device = {};
  if (process.platform === 'win32') {
    if (release().split('.')[0] < 10) {
      console.log('win 7 ');
      return null;
    }
    device = await bluetooth.requestDevice({
      filters: [{ services: [MUSE_SERVICE] }]
    });
  } else {
    device = await navigator.bluetooth.requestDevice({

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