brainaccess.core.stream_rate#

Classes#

StreamRate

Sample rates the library knows.

Module Contents#

class brainaccess.core.stream_rate.StreamRate(*args, **kwds)[source]#

Bases: enum.Enum

Sample rates the library knows.

A headset supports only some of them (250 and 500 Hz on every model, 1000 Hz on HALO V3, 1000 and 2000 Hz on EXG8). The setter set_sample_rate() takes the rate in Hz, not a member of this enum; use from_hz() and to_hz to convert.

Variables:
  • X16kHz (int) – 16000 Hz.

  • X8kHz (int) – 8000 Hz.

  • X4kHz (int) – 4000 Hz.

  • X2kHz (int) – 2000 Hz.

  • X1kHz (int) – 1000 Hz.

  • X500Hz (int) – 500 Hz.

  • X250Hz (int) – 250 Hz.

  • UNKNOWN (int) – An unrecognized rate.

classmethod from_hz(hz)[source]#

Get the member for a sample rate.

Parameters:

hz (int) – Sample rate in Hz.

Returns:

The matching member, or UNKNOWN if there is none.

Return type:

StreamRate

UNKNOWN = 255[source]#
X16kHz = 0[source]#
X1kHz = 4[source]#
X250Hz = 6[source]#
X2kHz = 3[source]#
X4kHz = 2[source]#
X500Hz = 5[source]#
X8kHz = 1[source]#
property to_hz: int[source]#

The sample rate in Hz, or -1 for UNKNOWN.

Return type:

int