Skip to main content

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​

Implement with AI Assistance

Build with AI

Implement this workflow with AI

Use the official Manage AIBuds Volume skill to adapt this workflow to your app.

Read and follow https://docs-aibuds.github.io/skills/manage-aibuds-volume. Use it to implement Manage AIBuds Volume in this iOS project and verify the result.
View official skill

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
}

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.