### Start Recording Source: https://eatsteak.github.io/CyKit-macos/recording.html Initiates recording to the specified file path. Ensure the path is valid before calling. ```python client.control.start_recording(path) ``` -------------------------------- ### Stream EEG Data with CyKit Source: https://eatsteak.github.io/CyKit-macos/quickstart.html Installs the package and connects to a supported headset to stream EEG data. Requires CyKit to be installed. ```python from cykit import CyKitClient, Model with CyKitClient(Model.INSIGHT_CONSUMER) as client: for sample in client.stream(): print(sample.eeg) break ``` -------------------------------- ### Initialize CyKit Client and Stream EEG Data Source: https://eatsteak.github.io/CyKit-macos/_sources/quickstart.rst.txt Establishes a connection to the headset using the INSIGHT_CONSUMER model and prints the first available EEG sample. ```python from cykit import CyKitClient, Model with CyKitClient(Model.INSIGHT_CONSUMER) as client: for sample in client.stream(): print(sample.eeg) break ``` -------------------------------- ### CyKitClient Initialization and Control Source: https://eatsteak.github.io/CyKit-macos/api.html The CyKitClient is the primary interface for managing device connections and streaming EEG data. ```APIDOC ## CyKitClient ### Description Public synchronous client for CyKit device discovery, streaming, and control. ### Parameters - **model** (Model | int) - Required - Target headset model. - **connection** (ConnectionOptions) - Optional - Transport and discovery settings. - **stream** (StreamOptions) - Optional - Stream formatting and runtime behavior options. - **output** (OutputOptions) - Optional - Output normalization and compatibility options. ### Methods - **connect()**: Connect to the configured device and prepare streaming. - **stream()**: Yield decoded EEG samples until the caller stops or the client closes. - **close()**: Close the active connection and release runtime state. - **start_background_stream()**: Initiates streaming in the background. ### Exceptions - **ConnectionError**: Raised if the client cannot initialize the selected transport or prepare a device. ``` -------------------------------- ### Sample Data Structure Source: https://eatsteak.github.io/CyKit-macos/api.html Represents a single data sample from a device. ```APIDOC ## class cykit.Sample ### Description Represents a single data sample from a device. ### Fields - **packet_kind** (int | None) - The kind of packet. - **quality** (int | None) - The quality of the sample. - **raw** (bytes | str | None) - Raw data associated with the sample. ``` -------------------------------- ### Device Discovery Source: https://eatsteak.github.io/CyKit-macos/api.html Discover available CyKit-compatible devices using specified transport and timeout. ```APIDOC ## cykit.discover() ### Description Discover available CyKit-compatible devices. ### Method GET ### Endpoint /discover ### Parameters #### Query Parameters - **transport** (Transport) - Optional - Preferred transport. Use `Transport.AUTO` to search all supported transports. - **timeout** (float) - Optional - Scan timeout in seconds for transport layers that need active discovery. ### Returns - **list[DeviceInfo]** - A list of discovered devices. ### Raises - **DiscoveryError** - If the requested transport cannot be queried. ``` -------------------------------- ### Connection and Stream Configuration Source: https://eatsteak.github.io/CyKit-macos/api.html Configuration classes used to define how the CyKitClient connects to devices and formats incoming data streams. ```APIDOC ## ConnectionOptions ### Description Defines transport and discovery settings for the device connection. ### Fields - **transport** (Transport) - Optional - Transport mode (default: auto). - **device_key** (str | None) - Optional - Specific device identifier. - **scan_timeout** (float) - Optional - Timeout for device discovery (default: 15.0). - **connect_timeout** (float) - Optional - Timeout for connection (default: 15.0). - **confirm_device** (bool) - Optional - Whether to confirm device identity (default: False). ## OutputOptions ### Description Defines output normalization and compatibility settings. ### Fields - **format** (int) - Optional - Output format identifier. - **integer_values** (bool) - Optional - Whether to use integer values. - **verbose** (bool) - Optional - Enable verbose logging. ``` -------------------------------- ### CyKit API Reference - Core Components Source: https://eatsteak.github.io/CyKit-macos/index.html This section lists the core classes and functions available in the CyKit API. These are fundamental building blocks for interacting with the Emotiv EEG acquisition system. ```APIDOC ## CyKit API Reference This section provides details on the core components of the CyKit Python library. ### Core Classes and Functions - **`ConnectionError`**: Represents errors related to establishing a connection. - **`ConnectionOptions`**: Options for configuring a connection. - **`ControlError`**: Represents errors during runtime control operations. - **`CyKitClient`**: The main client class for interacting with the CyKit API. - **`CyKitError`**: Base class for all CyKit-specific errors. - **`DataMode`**: Enum for specifying data acquisition modes. - **`DeviceInfo`**: Information about connected EEG devices. - **`DiscoveryError`**: Represents errors during device discovery. - **`Model`**: Represents a machine learning model used with EEG data. - **`OutputOptions`**: Options for configuring data output. - **`RecordingError`**: Represents errors during data recording. - **`Sample`**: Represents a single data sample from the EEG device. - **`StreamError`**: Represents errors related to data streaming. - **`StreamOptions`**: Options for configuring data streaming. - **`Transport`**: Represents the communication transport layer. ### Functions - **`discover()`**: Discovers available Emotiv EEG devices. ``` -------------------------------- ### Stream Options Source: https://eatsteak.github.io/CyKit-macos/api.html Configuration options for data streaming. ```APIDOC ## class cykit.StreamOptions ### Description Configuration options for data streaming. ### Fields - **baseline** (bool) - Default: `False` - **data_mode** (DataMode) - Default: `DataMode.EEG` (1) - **delimiter** (str) - Default: `,` - **filter_enabled** (bool) - Default: `False` - **include_header** (bool) - Default: `True` - **include_raw** (bool) - Default: `False` - **openvibe** (bool) - Default: `False` - **openvibe_delay** (int) - Default: `100` - **openvibe_samples** (int) - Default: `4` ``` -------------------------------- ### Recording Control API Source: https://eatsteak.github.io/CyKit-macos/recording.html Endpoints for managing data recording sessions in CyKit. ```APIDOC ## POST /client/control/start_recording ### Description Starts a new recording session and saves it to the specified path. ### Method POST ### Endpoint /client/control/start_recording ### Parameters #### Request Body - **path** (string) - Required - The file path where the recording will be saved. --- ## POST /client/control/stop_recording ### Description Stops the currently active recording session. ### Method POST ### Endpoint /client/control/stop_recording ``` -------------------------------- ### Recording Control API Source: https://eatsteak.github.io/CyKit-macos/_sources/recording.rst.txt This section covers the methods for controlling the recording process. ```APIDOC ## Recording Control API ### Description Provides methods to manage the recording process, including starting and stopping. ### Methods #### Start Recording - **Method**: `client.control.start_recording(path)` - **Description**: Initiates the recording process and saves it to the specified path. - **Parameters**: - `path` (string) - Required - The file path where the recording will be saved. #### Stop Recording - **Method**: `stop_recording()` - **Description**: Stops the currently active recording session. ### Request Example ```python # Example of starting a recording client.control.start_recording("/path/to/save/recording.mp4") # Example of stopping a recording client.control.stop_recording() ``` ### Response Recording methods typically do not return specific data upon success, but errors may be raised if the operation fails (e.g., invalid path, recording already in progress). ``` -------------------------------- ### StreamError Exception Source: https://eatsteak.github.io/CyKit-macos/api.html Exception raised when streaming cannot continue. ```APIDOC ## exception cykit.StreamError ### Description Raised when streaming cannot continue. ### Bases `CyKitError` ``` -------------------------------- ### Stop Recording Source: https://eatsteak.github.io/CyKit-macos/recording.html Halts the ongoing recording process. This function does not require any arguments. ```python stop_recording() ``` -------------------------------- ### Transport Enum Source: https://eatsteak.github.io/CyKit-macos/api.html Defines the available transport methods for device communication. ```APIDOC ## class cykit.Transport ### Description Defines the available transport methods for device communication. ### Members - **AUTO** = 'auto' - **BLUETOOTH** = 'bluetooth' - **USB** = 'usb' ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.