Skip to content

Core Volume Control Overview

Mr.P edited this page Aug 25, 2026 · 2 revisions

Volume Control Overview

Volume Control exposes the device's volume-setting capability, its current volume snapshot, and commands for setting or stepping supported volume channels.

Available Features

Browse the generated Wiki navigation for the pages in this section.

Getting Started

  1. Connect to the Device - Wait until the device is connected and ready.
  2. Check Protocol Conformance - Verify support for DeviceVolumeControlAPI.
  3. Read the Capability - Use volumeSetCapability before showing controls.
  4. Read Current Values - Use the optional volumesInfo snapshot.
  5. Set a Supported Channel - Use a value from DeviceVolumeType and a level from 0 through 100.

Key Concepts

Capability

VolumeSetCapability reports .none, .common, or .advanced.

  • .none does not expose SDK volume setting.
  • .common supports system-prompt, media, and in-call volume controls.
  • .advanced additionally exposes local-playback volume in the current snapshot, but the current public SDK does not provide a local-playback write API.

Volume Channels

DeviceVolumeType currently includes system prompt, media playback, and in-call volume. Each setter accepts a level from 0 through 100.

Protocol Reference

Volume Control is accessed through DeviceVolumeControlAPI:

Swift

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

Objective-C

id<AIBudsDeviceVolumeControlAPI> device =
    (id<AIBudsDeviceVolumeControlAPI>)self.device;
if (![device conformsToProtocol:@protocol(AIBudsDeviceVolumeControlAPI)]) {
    NSLog(@"Device does not support AIBudsDeviceVolumeControlAPI");
    return;
}

Best Practices

  1. Check Capability: Do not show write controls for .none.
  2. Validate Levels: Keep explicit values within 0 through 100.
  3. Debounce Continuous Controls: Avoid sending a command for every intermediate slider event.
  4. Observe Changes: Use didVolumesChanged when the UI must track device-side updates.

Notes

  • volumesInfo is optional and individual values can also be unavailable.
  • The current SDK can read localPlaybackVolume, but cannot set it separately. Add that control only after a public write API is introduced.
  • Hardware controls or other clients can change device volume after a snapshot is read.

AIBuds SDK iOS Wiki

Clone this wiki locally