Skip to main content

Work Mode Overview

Welcome to the Work Mode documentation for the AIBuds SDK. This section covers APIs for managing the device's operational mode, such as normal mode and game mode.

Available Features

Getting Started

To work with work modes, follow these steps:

  1. Connect to Device - Establish a connection with your AIBuds device
  2. Check Protocol Conformance - Verify the device conforms to DeviceWorkModeAPI protocol
  3. Get Current Mode - Read the workMode property
  4. Set Mode - Call setWorkMode(_:completion:) with a WorkMode value

Key Concepts

Work Modes

WorkMode defines the following values:

Available modes

Values exposed by WorkMode and their role in mode selection.

3
.unknown

The current mode is unavailable or unrecognized. This fallback value cannot be selected.

AIBudsWorkModeUnknown
-1
.normal

The device's normal operating mode. Product-specific audio behavior is not defined by the SDK.

AIBudsWorkModeNormal
0
.game

The device's game mode. Product-specific latency and audio processing are not defined by the SDK.

AIBudsWorkModeGame
1
WorkMode.allCases contains normal and game. Do not pass unknown to setWorkMode.

Protocol Reference

Work mode functionality is accessed through the DeviceWorkModeAPI protocol:

Swift
guard let device = device as? DeviceWorkModeAPI else {
    print("Device does not support DeviceWorkModeAPI")
    return
}

Best Practices

  1. Check Protocol Conformance: Always verify the device supports the DeviceWorkModeAPI protocol
  2. Handle Mode Changes: Implement device(_:didWorkModeChanged:) when the device delegate should receive updates
  3. Provide Feedback: Inform users when the mode is successfully changed
  4. Respect User Intent: Change work mode only in response to an appropriate application or user action

Notes

  • Not all devices support multiple work modes
  • Available modes depend on device capabilities
  • The public API does not define device-specific audio or latency effects for a mode