Cortex Library for Mobile
  • Getting Started
  • Objective-C API for iOS
    • CortexLib class
    • CortexClient class
    • CortexClientDelegate protocol
  • Java API for Android
    • EmotivLibraryLoader class
    • CortexLib class
    • CortexClient class
  • Additional JSON methods
    • loginWithAuthenticationCode
    • logout
    • queryVirtualHeadsets
    • createVirtualHeadset
    • deleteVirtualHeadset
    • updateVirtualHeadset
    • triggerVirtualHeadsetEvent
    • Virtual headset object
    • freeUpRecords
  • Release Notes
Powered by GitBook
On this page
  • Parameters
  • pm and preRecordedSamples
  • mc
  • fe
  • Result
  • Example
  1. Additional JSON methods

createVirtualHeadset

This method lets you create a new virtual headset.

Parameters

Name

Type

Required

Description

cortexToken

string

yes

type

string

yes

The type of the headset to create.

The possible values are "MN8", "INSIGHT", "EPOCPLUS", "EPOCX", "EPOCFLEX".

motionRate

number

no

If the type is "EPOCPLUS" or "EPOCX", then you must set the motion rate to 0, 32 or 64 Hertz. The value 64 is only available on Android.

The default value is 0.

name

string

no

powerOn

boolean

no

The default value is false

battery

number

no

The battery level of the headset. It is an integer in the range [0, 4].

The default value is zero.

cq

object

no

This parameter sets the contact quality of each EEG sensor of the headset. It is an object. The keys are the name of the sensors, the values are integers in the range [0, 4]. Example for a MN8 headset: {"T7": 4, "T8": 0}

pm

object

no

See below.

preRecordedSamples

string

no

See below.

mc

object

no

See below.

fe

object

no

See below.

pm and preRecordedSamples

These two parameters sets the output of the performance metric detection.

The possible value for preRecordedSamples are "low", "mid"," high" or an empty string.

Value

Description

"low"

All the PM will output low (around 0.2) random values.

"mid"

All the PM will output medium (around 0.5) random values.

"high"

All the PM will output high (around 0.8) random values.

Empty string

You can use the parameter pm to manually set the output of each individual PM.

The parameter pm is an object. Each key is the name of a PM, and each value is an object. The available PM depends on the type of the virtual headset and the version of Cortex. New PM can be added in the future.

Example for a virtual Insight headset:

{
  "engagement": {
    "isActive": true,
    "score": 0.9
  },
  "excitement": {
    "isActive": true,
    "score": 0.25
  },
  "focus": {
    "isActive": true,
    "score": 0.4
  },
  "interest": {
    "isActive": false,
    "score": 0.0
  },
  "relaxation": {
    "isActive": true,
    "score": 0.6
  },
  "stress": {
    "isActive": true,
    "score": 0.5
  }
}

mc

This parameter sets the output of the mental command detection. It is an object that contains these fields:

Name

Type

Required

Description

action

string

yes

The name of the action. The possible values are "neutral", "push", "pull", "lift", "drop", "left", "right", "rotateLeft", "rotateRight", "rotateClockwise", "rotateCounterClockwise", "rotateForwards", "rotateReverse", "disappear".

power

number

yes

The power of this action. It must be a number between zero and one.

If you omit this parameter when creating the virtual headset, then the default action is "neutral", with a power of zero.

fe

This parameter sets the output of the facial expression detection. It is an object that contains these fields:

Name

Type

Required

Description

upperFaceAction

string

yes

The action of the upper face. The possible values are "neutral", "frown" and "surprise".

lowerFaceAction

string

yes

The action of the lower face. The possible values are "neutral", "clench" and "smile".

upperFacePower

number

yes

The power of the upper face action. It must be a number between zero and one.

lowerFacePower

number

yes

The power of the lower face action. It must be a number between zero and one.

If you omit this parameter when creating the virtual headset, then the default actions are "neutral", with a power of zero.

Result

Example

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "createVirtualHeadset",
  "params": {
    "cortexToken": "xxx",
    "type": "INSIGHT"
  }
}
{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "battery": 0,
    "connectionType": "bluetooth",
    "cq": {},
    "cqStatus": "",
    "fe": {
      "lowerFaceAction": "neutral",
      "lowerFacePower": 0,
      "upperFaceAction": "neutral",
      "upperFacePower": 0
    },
    "mc": {
      "action": "neutral",
      "power": 0
    },
    "name": "",
    "ownerId": "c7f6d941-d972-496b-8504-fcc903c46f02",
    "pm": {},
    "powerOn": false,
    "preRecordedSamples": "",
    "serial": "B651BE6B",
    "type": "INSIGHT",
    "uuid": "b651be6b-135a-4c42-9075-d07b238725de"
  }
}
PreviousqueryVirtualHeadsetsNextdeleteVirtualHeadset

Last updated 4 years ago

A token returned by

The name of the headset. When you call you will find this name in the field customName

If true then this virtual headset is ON. So you can see this headset in the result of . If false then this virtual headset is OFF. It will not appear in the result of queryHeadsets. But it will still be visible in the result of .

The result is a .

Virtual headset object
authorize
queryHeadsets
queryHeadsets
queryVirtualHeadsets