Music Control Overview
Music Control sends playback and playback-volume commands through a connected AIBuds device.
Available Features
Control Music Playback
Control playback, track navigation, muting, and playback volume
Getting Started
- Connect to the Device - Wait until the device is connected and ready.
- Check Protocol Conformance - Verify support for
DeviceMusicControlAPI. - Choose a Command - Play, pause, select the next or previous track, or adjust playback volume.
- Handle Completion - Update application UI only after the command reports success.
Key Concepts
Playback Commands
playMusicstarts or resumes playback.pauseMusicpauses playback.playNextMusicandplayPreviousMusicnavigate the playback queue.- The public protocol does not define a stop command.
Playback Volume Commands
musicVolumeUpandmusicVolumeDownmove by one device-defined step.muteandunmutecontrol playback muting.setMusicVolumeaccepts an explicit level from 0 through 100.
Protocol Reference
Music Control is accessed through DeviceMusicControlAPI:
- Swift
- Objective-C
guard let device = device as? DeviceMusicControlAPI else {
print("Device does not support DeviceMusicControlAPI")
return
}id<AIBudsDeviceMusicControlAPI> device = (id<AIBudsDeviceMusicControlAPI>)self.device;
if (![device conformsToProtocol:@protocol(AIBudsDeviceMusicControlAPI)]) {
NSLog(@"Device does not support AIBudsDeviceMusicControlAPI");
return;
}Best Practices
- Check Protocol Conformance: The SDK exposes no separate Boolean support query.
- Handle Every Completion: Check
successand reporterrorwhen a command fails. - Debounce Sliders: Avoid sending every intermediate explicit volume value.
- Observe Playback Changes: Use
didMediaPlayStatusChangedwhen the UI must follow device notifications.
Notes
- The SDK does not expose the active player, track metadata, or playback queue through this protocol.
- Command success confirms command execution, not a permanent playback state.
- Volume Control and Music Control are separate protocols even though both include volume-related operations.