PlanetKitAudioDeviceChangeDelegate
@objc
public protocol PlanetKitAudioDeviceChangeDelegate
A delegate protocol for handling audio device changes in PlanetKit.
-
Called when the list of audio devices is updated.
Declaration
Swift
func didAudioDevicesUpdate(devices: [PlanetKitAudioDevice])
Parameters
devices
An array of
PlanetKitAudioDevice
instances representing the updated list of audio devices. -
Called when the active audio device changes.
Note
The PlanetKit audio system does not automatically restart when the audio device changes. You must manually restart the audio system with the updated device within this event handler.Declaration
Swift
func didAudioDeviceChange(device: PlanetKitAudioDevice?, type: PlanetKitAudioDeviceType)
Parameters
device
The newly active
PlanetKitAudioDevice
instance.type
The category of the audio device that has changed.
-
Called when the default system audio device changes.
Declaration
Swift
@objc optional func didAudioDefaultSystemDeviceChange(device: PlanetKitAudioDevice?, type: PlanetKitAudioDeviceType)
Parameters
device
The new default system
PlanetKitAudioDevice
instance.type
The category of the audio device that has changed.
-
Called when the data source of an audio device changes.
Declaration
Swift
@objc optional func didAudioDeviceDataSourceChange(device: PlanetKitAudioDevice, dataSource: UInt32)
Parameters
device
The
PlanetKitAudioDevice
instance whose data source has changed.dataSource
The new data source identifier.