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
View Volume Capability and Levels
Read the device's volume-setting capability and current volume snapshot
Set Volume
Set or step the supported device volume channels
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.Getting Started
- Connect to the Device - Wait until the device is connected and ready.
- Check Protocol Conformance - Verify support for
DeviceVolumeControlAPI. - Read the Capability - Use
volumeSetCapabilitybefore showing controls. - Read Current Values - Use the optional
volumesInfosnapshot. - Set a Supported Channel - Use a value from
DeviceVolumeTypeand a level from 0 through 100.
Key Concepts
Capability
VolumeSetCapability reports .none, .common, or .advanced.
.nonedoes not expose SDK volume setting..commonsupports system-prompt, media, and in-call volume controls..advancedadditionally 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
- Objective-C
guard let device = device as? DeviceVolumeControlAPI else {
print("Device does not support DeviceVolumeControlAPI")
return
}id<AIBudsDeviceVolumeControlAPI> device = (id<AIBudsDeviceVolumeControlAPI>)self.device;
if (![device conformsToProtocol:@protocol(AIBudsDeviceVolumeControlAPI)]) {
NSLog(@"Device does not support AIBudsDeviceVolumeControlAPI");
return;
}Best Practices
- Check Capability: Do not show write controls for
.none. - Validate Levels: Keep explicit values within 0 through 100.
- Debounce Continuous Controls: Avoid sending a command for every intermediate slider event.
- Observe Changes: Use
didVolumesChangedwhen the UI must track device-side updates.
Notes
volumesInfois 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.